diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 7f1e5569c..3d9400fac 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -327,7 +327,7 @@ const de: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index d7763d269..8d75dc146 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -327,7 +327,7 @@ const en: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', MODULES: 'Modules', MODULES_UPDATED: 'Modules updated', - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', MODULES_NONE: 'No external modules detected' }; diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index 78eed56de..0d46fcbe9 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -327,7 +327,7 @@ const fr: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index 81b005740..280ec5f91 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -327,7 +327,7 @@ const it: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index 77178012d..33d548bce 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -327,7 +327,7 @@ const no: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 879abace2..e31b8ff60 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -327,7 +327,7 @@ const pl: BaseTranslation = { UPLOAD_DOWNLOAD_1: 'Wysyłanie/pobieranie ustawień i firmware', MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index 346396c33..c4c65ce65 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -327,7 +327,7 @@ const sk: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index 533076383..5f06f30c8 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -327,7 +327,7 @@ const sv: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index b0a85d26e..15c2b1e33 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -327,7 +327,7 @@ const tr: Translation = { UPLOAD_DOWNLOAD_1: 'Upload/Download Settings and Firmware', // TODO translate MODULES: 'Module', // TODO translate MODULES_UPDATED: 'Modules updated', // TODO translate - MODULES_DESCRIPTION: 'Click on the Module to Activate or de-activate EMS-ESP library modules', // TODO translate + MODULES_DESCRIPTION: 'Click on the Module to activate or de-activate EMS-ESP library modules', // TODO translate MODULES_NONE: 'No external modules detected' // TODO translate }; diff --git a/interface/src/project/Modules.tsx b/interface/src/project/Modules.tsx index d60589721..6d639ba48 100644 --- a/interface/src/project/Modules.tsx +++ b/interface/src/project/Modules.tsx @@ -5,12 +5,9 @@ import { toast } from 'react-toastify'; import CancelIcon from '@mui/icons-material/Cancel'; import CircleIcon from '@mui/icons-material/Circle'; -import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew'; import WarningIcon from '@mui/icons-material/Warning'; import { Box, Button, Typography } from '@mui/material'; -import * as SystemApi from 'api/system'; - import { Body, Cell, @@ -26,11 +23,9 @@ import { BlockNavigation, ButtonRow, FormLoader, - MessageBox, SectionContent, useLayoutTitle } from 'components'; -import RestartMonitor from 'framework/system/RestartMonitor'; import { useI18nContext } from 'i18n/i18n-react'; import * as EMSESP from './api'; @@ -40,13 +35,10 @@ import type { ModuleItem, Modules } from './types'; const Modules: FC = () => { const { LL } = useI18nContext(); const [numChanges, setNumChanges] = useState(0); - const [licenseChanges, setLicenseChanges] = useState(0); const blocker = useBlocker(numChanges !== 0); const [selectedModuleItem, setSelectedModuleItem] = useState(); const [dialogOpen, setDialogOpen] = useState(false); - const [restarting, setRestarting] = useState(false); - const [restartNeeded, setRestartNeeded] = useState(false); const { data: modules, @@ -56,17 +48,6 @@ const Modules: FC = () => { initialData: [] }); - const { send: restartCommand } = useRequest(SystemApi.restart(), { - immediate: false - }); - - const restart = async () => { - await restartCommand().catch((error: Error) => { - toast.error(error.message); - }); - setRestarting(true); - }; - const { send: writeModules } = useRequest( (data: Modules) => EMSESP.writeModules(data), { @@ -140,17 +121,12 @@ const Modules: FC = () => { return mi.enabled !== mi.o_enabled || mi.license !== mi.o_license; } - function hasModuleLicenseChanged(mi: ModuleItem) { - return mi.license !== mi.o_license; - } - const updateModuleItem = (updatedItem: ModuleItem) => { updateState('modules', (data: ModuleItem[]) => { const new_data = data.map((mi) => mi.id === updatedItem.id ? { ...mi, ...updatedItem } : mi ); setNumChanges(new_data.filter((mi) => hasModulesChanged(mi)).length); - setLicenseChanges(new_data.filter((mi) => hasModuleLicenseChanged(mi)).length); return new_data; }); }; @@ -172,7 +148,6 @@ const Modules: FC = () => { .finally(() => { setNumChanges(0); }); - setRestartNeeded(licenseChanges > 0); }; const renderContent = () => { @@ -213,8 +188,10 @@ const Modules: FC = () => { {LL.NAME(0)} + {/* TODO translate */} Author {LL.VERSION()} + {/* TODO translate */} Message {LL.STATUS_OF('')} @@ -247,43 +224,30 @@ const Modules: FC = () => { )} - {restartNeeded ? ( - - - - ) : ( - - - {numChanges !== 0 && ( - - - - - )} - + + + {numChanges !== 0 && ( + + + + + )} - )} + ); }; @@ -291,7 +255,7 @@ const Modules: FC = () => { return ( {blocker ? : null} - {restarting ? : renderContent()} + {renderContent()} {selectedModuleItem && ( - - {LL.EDIT() + ' ' + LL.MODULES() + ' : ' + editItem.key} - + {LL.EDIT() + ' ' + editItem.key} logger().err("debug: in WebModules::read()"); // TODO remove JsonDocument doc_modules; JsonObject root_modules = doc_modules.to(); moduleLibrary.list(root_modules); // get list the external library modules, put in a json object