diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 3427278..f1b0ffc 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -74,6 +74,11 @@ function App() { }, []); + useEffect(() => { + EventsOn("reloadServers", getServers) + return () => EventsOff("reloadServers") + }, []); + //events useEffect(() => { EventsOn("serverSaved", getServers) diff --git a/frontend/src/pages/InstallUpdater.tsx b/frontend/src/pages/InstallUpdater.tsx index cc975d1..d9c74ce 100644 --- a/frontend/src/pages/InstallUpdater.tsx +++ b/frontend/src/pages/InstallUpdater.tsx @@ -32,7 +32,7 @@ export function InstallUpdater({setServ, serv, onInstalled}: Props) { const [installerModalOpen, setInstallerModalOpen] = useState(false) const {addAlert} = useAlert() function onServerPathClicked() { - OpenDirectoryDialog().then((val) => setServ((p) => ({ ...p, serverPath: val }))) + OpenDirectoryDialog().then((val) => setServ((p) => ({ ...p, serverPath: val, convertValues: p.convertValues }))) } function onStartInstallButtonClicked() { diff --git a/frontend/src/pages/Server.tsx b/frontend/src/pages/Server.tsx index 54c3c26..9998585 100644 --- a/frontend/src/pages/Server.tsx +++ b/frontend/src/pages/Server.tsx @@ -52,6 +52,8 @@ export const Server = ({id, className}: Props) => { const [isInstalled, setIsInstalled] = useState(false) const [serverStatus, setServerStatus] = useState(false) const [forceStopModalOpen, setForceStopModalOpen] = useState(false) + const [startModalOpen, setStartModalOpen] = useState(false) + const [updaterModalOpen, setUpdaterModalOpen] = useState(false) const {addAlert} = useAlert() @@ -86,6 +88,15 @@ export const Server = ({id, className}: Props) => { } }, [serv]); + useEffect(() => { + EventsOn("reloadServers", () => { + if (id !== undefined) { + GetServer(id).then((s) => {setServ(s)}).catch((reason) => console.error(reason)) + } + }) + return () => EventsOff("reloadServers") + }, []); + //endregion function onServerStartButtonClicked() { @@ -147,7 +158,7 @@ export const Server = ({id, className}: Props) => { {isInstalled? (
- setServ((p) => ({ ...p, serverAlias: e.target.value }))}/> + setServ((p) => ({ ...p, serverAlias: e.target.value, convertValues: p.convertValues }))}/> BrowserOpenURL("file:///" + serv.serverPath)}> @@ -156,7 +167,7 @@ export const Server = ({id, className}: Props) => {
- + @@ -182,6 +193,31 @@ export const Server = ({id, className}: Props) => { + setStartModalOpen(false)}> + + + + Confirmation + + + + Are you sure you want to start the server? This action will overwrite ini files in the server directory!
+
+ + + + + + + +
+
diff --git a/frontend/src/pages/server/Administration.tsx b/frontend/src/pages/server/Administration.tsx index 64f7508..010f9c4 100644 --- a/frontend/src/pages/server/Administration.tsx +++ b/frontend/src/pages/server/Administration.tsx @@ -7,7 +7,7 @@ import { FormLabel, Input, Modal, ModalDialog, - TabPanel, + TabPanel, Tooltip, Typography } from "@mui/joy"; import React, {useState} from "react"; @@ -151,6 +151,7 @@ export function Administration({setServ, serv, onServerFilesDeleted}: Props) { +