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 "./styles.sass";
|
||||||
import ErrorArea from "@/common/components/ErrorArea";
|
import ErrorArea from "@/common/components/ErrorArea";
|
||||||
import {StatusContext} from "@/common/contexts/Status";
|
import {StatusContext} from "@/common/contexts/Status";
|
||||||
|
import ServerDialog from "@/pages/tools/linux/components/ServerDialog";
|
||||||
|
import {ServerProvider} from "@/common/contexts/Server";
|
||||||
|
|
||||||
export const InstallSoftware = () => {
|
export const InstallSoftware = () => {
|
||||||
const [currentItem, setCurrentItem] = useState(Software[0].name);
|
const [currentItem, setCurrentItem] = useState(Software[0].name);
|
||||||
const backendAvailable = useContext(StatusContext);
|
const backendAvailable = useContext(StatusContext);
|
||||||
|
const [serverDialogOpen, setServerDialogOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<ServerProvider>
|
||||||
<InfoArea title="Software"
|
<InfoArea title="Software"
|
||||||
description="Aktuell nur für Debian/Ubuntu verfügbar. Installiere mit diesem Tool jede mögliche Software mit einem Klick :)">
|
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>
|
</InfoArea>
|
||||||
|
|
||||||
|
{serverDialogOpen && <ServerDialog onClose={() => setServerDialogOpen(false)}/>}
|
||||||
|
|
||||||
{!backendAvailable && <ErrorArea error="Es konnte keine Verbindung zum Backend-Server hergestellt werden."/>}
|
{!backendAvailable && <ErrorArea error="Es konnte keine Verbindung zum Backend-Server hergestellt werden."/>}
|
||||||
|
|
||||||
<div className={"install-area" + (!backendAvailable ? " not-available" : "")}>
|
<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} />})}
|
{Software.map((s) => {if (s.name === currentItem) return <ConfigurationArea current={s} key={s.name} />})}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</ServerProvider>
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user