diff --git a/src/api/upload.js b/src/api/upload.js index b6c235f9f..d62707026 100644 --- a/src/api/upload.js +++ b/src/api/upload.js @@ -96,6 +96,22 @@ export const getUploadByIdApi = (uploadId, retries) => { }); }; +// Updating an Upload's name and description +export const updateUploadApi = (uploadId, uploadName, uploadDescription) => { + const url = endpoints.upload.update(uploadId); + return sendRequest({ + url, + method: "PATCH", + headers: { + Authorization: getToken(), + }, + body: { + uploadName, + uploadDescription, + }, + }); +}; + // Getting a Upload Summary export const getUploadSummaryApi = (uploadId) => { const url = endpoints.upload.getSummary(uploadId); diff --git a/src/app/HomeClient/HomeClient.jsx b/src/app/HomeClient/HomeClient.jsx index 8e0490e7e..b94368b3d 100644 --- a/src/app/HomeClient/HomeClient.jsx +++ b/src/app/HomeClient/HomeClient.jsx @@ -1,218 +1,187 @@ /* - SPDX-FileCopyrightText: 2025 Tiyasa Kundu (tiyasakundu20@gmail.com) + SPDX-FileCopyrightText: Š 2025 FOSSology Contributors + SPDX-License-Identifier: GPL-2.0-only +*/ -SPDX-License-Identifier: GPL-2.0-only +"use client"; - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as published by the Free Software Foundation. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +import { useState } from "react"; - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +const HomeClient = () => { + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + const [showPassword, setShowPassword] = useState(false); + const [isLoading, setIsLoading] = useState(false); -'use client'; - -import { useState, useEffect } from 'react'; -import { useRouter, useSearchParams } from 'next/navigation'; -import { cn } from "@/lib/utils" - -import { Eye, EyeOff } from "lucide-react" -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { - Alert, - AlertTitle, - AlertDescription, -} from '@/components/ui/alert'; -import { - Card, - CardHeader, - CardTitle, - CardDescription, - CardContent, -} from "@/components/ui/card" - -import fetchToken from '@/services/auth'; -import { getUserSelf } from '@/services/users'; -import { fetchAllGroups } from '@/services/groups'; -import routes from '@/constants/routes'; -import { isAuth } from '@/shared/authHelper'; - -export default function HomeClient() { - const router = useRouter(); - const searchParams = useSearchParams(); - - const [values, setValues] = useState({ username: '', password: '' }); - const [loading, setLoading] = useState(false); - const [showError, setShowError] = useState(false); - const [errorMessage, setErrorMessage] = useState(null); - - const { username, password } = values; - - const handleChange = (name) => (event) => { - setValues({ ...values, [name]: event.target.value }); + const handleLogin = async () => { + setIsLoading(true); + setTimeout(() => setIsLoading(false), 2000); }; - const handleSubmit = async (event) => { - event.preventDefault(); - setLoading(true); - try { - await fetchToken(values); - await getUserSelf(); - await fetchAllGroups(); - router.push(routes.browse); - } catch (err) { - setLoading(false); - setErrorMessage(err.message); - setShowError(true); - } - }; - - useEffect(() => { - const message = searchParams.get('message'); - if (message) { - setErrorMessage(message); - setShowError(true); - router.replace(window.location.pathname); - } - }, [searchParams, router]); - - const [showPassword, setShowPassword] = useState(false) + const features = [ + { icon: "đ", title: "Upload Files", desc: "Upload files into the FOSSology repository" }, + { icon: "đĻ", title: "Unpack Files", desc: "Unpack zip, tar, bz2, iso and many others" }, + { icon: "đŗ", title: "Browse Trees", desc: "Browse upload file trees easily" }, + { icon: "đ", title: "Scan Licenses", desc: "Scan for software licenses automatically" }, + { icon: "Šī¸", title: "Scan Copyrights", desc: "Scan for copyrights and author information" }, + { icon: "đ", title: "Compare Trees", desc: "View side-by-side license and bucket differences" }, + ]; return ( -
- FOSSology is a framework for software analysis tools. With it, you can: -
- -- This login uses HTTP, so passwords are transmitted in plain text. This is not a secure connection. +
+ A framework for software analysis, license compliance, + and copyright detection at scale. +
+ + {/* ââ Main Card ââ */} ++ {f.desc}
- - -+ FOSSology â Open Source License Compliance +