import TitledGreyBox from '@/components/elements/TitledGreyBox'; import Button from '@/components/elements/Button'; import { Dialog } from '@/components/elements/dialog'; import { useCurrentServer, useReinstallServer } from '@/api/server/queries'; import { canReinstallServer, SKIPPED_INSTALL_SCRIPT_MESSAGE } from '@/lib/serverStatus'; const ReinstallServerBox = () => { const server = useCurrentServer()!; const reinstallServer = useReinstallServer(); const canReinstall = canReinstallServer(server.attributes.status, server.attributes.skip_scripts); const reinstall = async (close: () => void) => { try { await reinstallServer.mutateAsync({ path: { server_uuid: server.attributes.uuid } }); close(); } catch { // Error toast is handled by the mutation. } }; return (

Reinstalling your server will stop it, and then re-run the installation script that initially set it up.  Some files may be deleted or modified during this process, please back up your data before continuing.

{!canReinstall &&

{SKIPPED_INSTALL_SCRIPT_MESSAGE}

} reinstall(close)} trigger={({ onClick }) => (
Reinstall Server
)} > Your server will be stopped and some files may be deleted or modified during this process, are you sure you wish to continue?
); }; export default ReinstallServerBox;