import { useEffect, useState } from 'react' import { apiRequest } from '../api/client' import { Check, X, Loader2, Package } from 'lucide-react' interface Software { id: string name: string desc: string pkg: string installed: boolean version: string } export function SoftPage() { const [software, setSoftware] = useState([]) const [loading, setLoading] = useState(true) const [error, setError] = useState('') const [actionId, setActionId] = useState(null) const load = () => { setLoading(true) apiRequest<{ software: Software[] }>('/soft/list') .then((data) => setSoftware(data.software || [])) .catch((err) => setError(err.message)) .finally(() => setLoading(false)) } useEffect(() => { load() }, []) const handleInstall = (id: string) => { setActionId(id) setError('') apiRequest<{ status: boolean }>(`/soft/install/${id}`, { method: 'POST' }) .then(() => load()) .catch((err) => setError(err.message)) .finally(() => setActionId(null)) } const handleUninstall = (id: string, name: string) => { if (!confirm(`Uninstall ${name}?`)) return setActionId(id) setError('') apiRequest<{ status: boolean }>(`/soft/uninstall/${id}`, { method: 'POST' }) .then(() => load()) .catch((err) => setError(err.message)) .finally(() => setActionId(null)) } if (loading) return
Loading...
return (

App Store

{error && (
{error}
)}
Install/uninstall via apt. Panel must run with sufficient privileges. Target: Debian/Ubuntu.
{software.map((s) => (

{s.name}

{s.desc}

{s.installed ? ( {s.version || 'Installed'} ) : ( Not installed )}
{s.installed ? ( ) : ( )}
))}
) }