Integrated the ServerDialog into the InstallSoftware.jsx
This commit is contained in:
parent
d734b07109
commit
e0d0a9d0d2
@ -8,18 +8,23 @@ import ConfigurationArea from "@/pages/tools/linux/InstallSoftware/components/Co
|
||||
import "./styles.sass";
|
||||
import ErrorArea from "@/common/components/ErrorArea";
|
||||
import {StatusContext} from "@/common/contexts/Status";
|
||||
import ServerDialog from "@/pages/tools/linux/components/ServerDialog";
|
||||
import {ServerProvider} from "@/common/contexts/Server";
|
||||
|
||||
export const InstallSoftware = () => {
|
||||
const [currentItem, setCurrentItem] = useState(Software[0].name);
|
||||
const backendAvailable = useContext(StatusContext);
|
||||
const [serverDialogOpen, setServerDialogOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ServerProvider>
|
||||
<InfoArea title="Software"
|
||||
description="Aktuell nur für Debian/Ubuntu verfügbar. Installiere mit diesem Tool jede mögliche Software mit einem Klick :)">
|
||||
<Button icon={faGear} text="Konfigurieren" onClick={() => {}}/>
|
||||
<Button icon={faGear} text="Konfigurieren" onClick={() => setServerDialogOpen(true)}/>
|
||||
</InfoArea>
|
||||
|
||||
{serverDialogOpen && <ServerDialog onClose={() => setServerDialogOpen(false)}/>}
|
||||
|
||||
{!backendAvailable && <ErrorArea error="Es konnte keine Verbindung zum Backend-Server hergestellt werden."/>}
|
||||
|
||||
<div className={"install-area" + (!backendAvailable ? " not-available" : "")}>
|
||||
@ -27,7 +32,7 @@ export const InstallSoftware = () => {
|
||||
|
||||
{Software.map((s) => {if (s.name === currentItem) return <ConfigurationArea current={s} key={s.name} />})}
|
||||
</div>
|
||||
</>
|
||||
</ServerProvider>
|
||||
);
|
||||
|
||||
}
|
Reference in New Issue
Block a user