From 5f0df140b0d0dda50c4491c1d673474c248d4aa2 Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 8 Nov 2025 16:28:04 +0100 Subject: [PATCH] factory reset show system monitor --- interface/src/app/settings/Settings.tsx | 213 +++++++++++++----------- 1 file changed, 114 insertions(+), 99 deletions(-) diff --git a/interface/src/app/settings/Settings.tsx b/interface/src/app/settings/Settings.tsx index 57472392d..608c37ee9 100644 --- a/interface/src/app/settings/Settings.tsx +++ b/interface/src/app/settings/Settings.tsx @@ -1,4 +1,4 @@ -import { useCallback, useState } from 'react'; +import { useCallback, useMemo, useState } from 'react'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; import CancelIcon from '@mui/icons-material/Cancel'; @@ -30,11 +30,14 @@ import { SectionContent, useLayoutTitle } from 'components'; import ListMenuItem from 'components/layout/ListMenuItem'; import { useI18nContext } from 'i18n/i18n-react'; +import SystemMonitor from '../status/SystemMonitor'; + const Settings = () => { const { LL } = useI18nContext(); useLayoutTitle(LL.SETTINGS(0)); const [confirmFactoryReset, setConfirmFactoryReset] = useState(false); + const [restarting, setRestarting] = useState(); const { send: sendAPI } = useRequest((data: APIcall) => API(data), { immediate: false @@ -42,6 +45,7 @@ const Settings = () => { const doFormat = useCallback(async () => { await sendAPI({ device: 'system', cmd: 'format', id: 0 }).then(() => { + setRestarting(true); setConfirmFactoryReset(false); }); }, [sendAPI]); @@ -54,120 +58,131 @@ const Settings = () => { setConfirmFactoryReset(true); }, []); - return ( - - - + const content = useMemo(() => { + return ( + <> + + - + - + - + - + - + - + - - + + - - {LL.FACTORY_RESET()} - {LL.SYSTEM_FACTORY_TEXT_DIALOG()} - - + + {LL.FACTORY_RESET()} + {LL.SYSTEM_FACTORY_TEXT_DIALOG()} + + + + + + + + + - - + + + ); + }, [ + LL, + handleFactoryResetClick, + handleFactoryResetClose, + doFormat, + confirmFactoryReset, + restarting + ]); - - - - - - - ); + return {restarting ? : content}; }; export default Settings;