diff --git a/interface/package.json b/interface/package.json
index 9ff23469e..d5c97796f 100644
--- a/interface/package.json
+++ b/interface/package.json
@@ -50,10 +50,12 @@
"typescript": "^5.4.5"
},
"devDependencies": {
+ "@babel/core": "^7.24.5",
"@eslint/js": "^9.2.0",
"@preact/compat": "^17.1.2",
"@preact/preset-vite": "^2.8.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
+ "@types/babel__core": "^7",
"concurrently": "^8.2.2",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
diff --git a/interface/src/AuthenticatedRouting.tsx b/interface/src/AuthenticatedRouting.tsx
index 00ca0d836..3b5344168 100644
--- a/interface/src/AuthenticatedRouting.tsx
+++ b/interface/src/AuthenticatedRouting.tsx
@@ -43,10 +43,7 @@ const AuthenticatedRouting: FC = () => {
} />
} />
} />
- }
- />
+ } />
} />
>
)}
diff --git a/interface/src/CustomTheme.tsx b/interface/src/CustomTheme.tsx
index 03c03c6a3..b42b7d0cc 100644
--- a/interface/src/CustomTheme.tsx
+++ b/interface/src/CustomTheme.tsx
@@ -15,8 +15,7 @@ export const dialogStyle = {
borderColor: '#565656',
borderStyle: 'solid',
borderWidth: '1px'
- },
- backdropFilter: 'blur(1px)'
+ }
};
const theme = responsiveFontSizes(
diff --git a/interface/src/framework/Settings.tsx b/interface/src/framework/Settings.tsx
index 6164406ad..9ce091ce2 100644
--- a/interface/src/framework/Settings.tsx
+++ b/interface/src/framework/Settings.tsx
@@ -1,5 +1,4 @@
import { type FC, useState } from 'react';
-import { toast } from 'react-toastify';
import AccessTimeIcon from '@mui/icons-material/AccessTime';
import CancelIcon from '@mui/icons-material/Cancel';
@@ -7,7 +6,6 @@ import DeviceHubIcon from '@mui/icons-material/DeviceHub';
import ImportExportIcon from '@mui/icons-material/ImportExport';
import LockIcon from '@mui/icons-material/Lock';
import MemoryIcon from '@mui/icons-material/Memory';
-import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';
import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
import SettingsEthernetIcon from '@mui/icons-material/SettingsEthernet';
import SettingsInputAntennaIcon from '@mui/icons-material/SettingsInputAntenna';
@@ -19,6 +17,7 @@ import {
DialogActions,
DialogContent,
DialogTitle,
+ Divider,
List
} from '@mui/material';
@@ -26,118 +25,25 @@ import * as SystemApi from 'api/system';
import { dialogStyle } from 'CustomTheme';
import { useRequest } from 'alova';
-import { ButtonRow, SectionContent, useLayoutTitle } from 'components';
+import { SectionContent, useLayoutTitle } from 'components';
import ListMenuItem from 'components/layout/ListMenuItem';
import { useI18nContext } from 'i18n/i18n-react';
-import RestartMonitor from './system/RestartMonitor';
-
const Settings: FC = () => {
const { LL } = useI18nContext();
useLayoutTitle(LL.SETTINGS(0));
- const [confirmRestart, setConfirmRestart] = useState(false);
const [confirmFactoryReset, setConfirmFactoryReset] = useState(false);
- const [processing, setProcessing] = useState(false);
- const [restarting, setRestarting] = useState();
-
- const { send: restartCommand } = useRequest(SystemApi.restart(), {
- immediate: false
- });
const { send: factoryResetCommand } = useRequest(SystemApi.factoryReset(), {
immediate: false
});
- const { send: partitionCommand } = useRequest(SystemApi.partition(), {
- immediate: false
- });
-
- const restart = async () => {
- setProcessing(true);
- await restartCommand()
- .then(() => {
- setRestarting(true);
- })
- .catch((error: Error) => {
- toast.error(error.message);
- })
- .finally(() => {
- setConfirmRestart(false);
- setProcessing(false);
- });
- };
-
const factoryReset = async () => {
- setProcessing(true);
- await factoryResetCommand()
- .then(() => {
- setRestarting(true);
- })
- .catch((error: Error) => {
- toast.error(error.message);
- })
- .finally(() => {
- setConfirmFactoryReset(false);
- setProcessing(false);
- });
+ await factoryResetCommand();
+ setConfirmFactoryReset(false);
};
- const partition = async () => {
- setProcessing(true);
- await partitionCommand()
- .then(() => {
- setRestarting(true);
- })
- .catch((error: Error) => {
- toast.error(error.message);
- })
- .finally(() => {
- setConfirmRestart(false);
- setProcessing(false);
- });
- };
-
- const renderRestartDialog = () => (
-
- );
-
const renderFactoryResetDialog = () => (
);
+ const restart = async () => {
+ setProcessing(true);
+ await restartCommand()
+ .then(() => {
+ setRestarting(true);
+ })
+ .catch((error: Error) => {
+ toast.error(error.message);
+ })
+ .finally(() => {
+ setConfirmRestart(false);
+ setProcessing(false);
+ });
+ };
+
+ const partition = async () => {
+ setProcessing(true);
+ await partitionCommand()
+ .then(() => {
+ setRestarting(true);
+ })
+ .catch((error: Error) => {
+ toast.error(error.message);
+ })
+ .finally(() => {
+ setConfirmRestart(false);
+ setProcessing(false);
+ });
+ };
+
+ const renderRestartDialog = () => (
+
+ );
+
const content = () => {
if (!data) {
return ;
@@ -198,13 +282,28 @@ const SystemStatus: FC = () => {
-
+
+
+
+
+
+
+
+ {me.admin && (
+ }
+ variant="outlined"
+ color="primary"
+ onClick={() => setConfirmRestart(true)}
+ >
+ {LL.RESTART()}
+
+ )}
+
+
@@ -252,7 +351,7 @@ const SystemStatus: FC = () => {
bgcolor="#68374d"
label={LL.SYSTEM_MEMORY()}
text={formatNumber(data.free_heap) + ' KB'}
- to="/settings/espsystemstatus"
+ to="/system/espsystemstatus"
/>
@@ -288,6 +387,7 @@ const SystemStatus: FC = () => {
{renderScanDialog()}
+ {renderRestartDialog()}