diff --git a/interface/src/framework/ap/APSettingsForm.tsx b/interface/src/framework/ap/APSettingsForm.tsx index 8c8163d32..66bfc2178 100644 --- a/interface/src/framework/ap/APSettingsForm.tsx +++ b/interface/src/framework/ap/APSettingsForm.tsx @@ -180,7 +180,7 @@ const APSettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/ap/APStatusForm.tsx b/interface/src/framework/ap/APStatusForm.tsx index 5a82f88e9..ffac701bd 100644 --- a/interface/src/framework/ap/APStatusForm.tsx +++ b/interface/src/framework/ap/APStatusForm.tsx @@ -60,14 +60,14 @@ const APStatusForm: FC = () => { - + IP - + @@ -76,7 +76,7 @@ const APStatusForm: FC = () => { - + @@ -99,7 +99,7 @@ const APStatusForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/ap/AccessPoint.tsx b/interface/src/framework/ap/AccessPoint.tsx index efc56217a..426c20006 100644 --- a/interface/src/framework/ap/AccessPoint.tsx +++ b/interface/src/framework/ap/AccessPoint.tsx @@ -22,12 +22,8 @@ const AccessPoint: FC = () => { return ( <> - - + + } /> diff --git a/interface/src/framework/mqtt/Mqtt.tsx b/interface/src/framework/mqtt/Mqtt.tsx index 436d784ef..5a8e6abb3 100644 --- a/interface/src/framework/mqtt/Mqtt.tsx +++ b/interface/src/framework/mqtt/Mqtt.tsx @@ -22,8 +22,8 @@ const Mqtt: FC = () => { return ( <> - - + + } /> diff --git a/interface/src/framework/mqtt/MqttSettingsForm.tsx b/interface/src/framework/mqtt/MqttSettingsForm.tsx index d4dbc5f55..c03915800 100644 --- a/interface/src/framework/mqtt/MqttSettingsForm.tsx +++ b/interface/src/framework/mqtt/MqttSettingsForm.tsx @@ -351,7 +351,7 @@ const MqttSettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/mqtt/MqttStatusForm.tsx b/interface/src/framework/mqtt/MqttStatusForm.tsx index 453db0948..8e6d373b5 100644 --- a/interface/src/framework/mqtt/MqttStatusForm.tsx +++ b/interface/src/framework/mqtt/MqttStatusForm.tsx @@ -121,7 +121,7 @@ const MqttStatusForm: FC = () => { - + @@ -137,7 +137,7 @@ const MqttStatusForm: FC = () => { - + {data.enabled && renderConnectionStatus()} @@ -152,7 +152,7 @@ const MqttStatusForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/network/NetworkConnection.tsx b/interface/src/framework/network/NetworkConnection.tsx index 02e4f7e8e..993a6181c 100644 --- a/interface/src/framework/network/NetworkConnection.tsx +++ b/interface/src/framework/network/NetworkConnection.tsx @@ -45,9 +45,9 @@ const NetworkConnection: FC = () => { }} > - + - + } /> diff --git a/interface/src/framework/network/NetworkSettingsForm.tsx b/interface/src/framework/network/NetworkSettingsForm.tsx index 206b920c3..8dd52b265 100644 --- a/interface/src/framework/network/NetworkSettingsForm.tsx +++ b/interface/src/framework/network/NetworkSettingsForm.tsx @@ -262,7 +262,7 @@ const WiFiSettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/network/NetworkStatusForm.tsx b/interface/src/framework/network/NetworkStatusForm.tsx index 3f84b1d47..10b020daa 100644 --- a/interface/src/framework/network/NetworkStatusForm.tsx +++ b/interface/src/framework/network/NetworkStatusForm.tsx @@ -124,7 +124,7 @@ const NetworkStatusForm: FC = () => { IP - + @@ -133,7 +133,7 @@ const NetworkStatusForm: FC = () => { - + @@ -158,7 +158,7 @@ const NetworkStatusForm: FC = () => { - + @@ -174,7 +174,7 @@ const NetworkStatusForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/ntp/NTPSettingsForm.tsx b/interface/src/framework/ntp/NTPSettingsForm.tsx index 34e302368..cda823dc4 100644 --- a/interface/src/framework/ntp/NTPSettingsForm.tsx +++ b/interface/src/framework/ntp/NTPSettingsForm.tsx @@ -96,7 +96,7 @@ const NTPSettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/ntp/NTPStatusForm.tsx b/interface/src/framework/ntp/NTPStatusForm.tsx index 986565a32..53aa235d3 100644 --- a/interface/src/framework/ntp/NTPStatusForm.tsx +++ b/interface/src/framework/ntp/NTPStatusForm.tsx @@ -149,7 +149,7 @@ const NTPStatusForm: FC = () => { - + {isNtpEnabled(data) && ( @@ -208,7 +208,7 @@ const NTPStatusForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/ntp/NetworkTime.tsx b/interface/src/framework/ntp/NetworkTime.tsx index bc39dedc3..37306ca4d 100644 --- a/interface/src/framework/ntp/NetworkTime.tsx +++ b/interface/src/framework/ntp/NetworkTime.tsx @@ -21,8 +21,8 @@ const NetworkTime: FC = () => { return ( <> - - + + } /> diff --git a/interface/src/framework/security/Security.tsx b/interface/src/framework/security/Security.tsx index 837add325..b2a5c855b 100644 --- a/interface/src/framework/security/Security.tsx +++ b/interface/src/framework/security/Security.tsx @@ -20,7 +20,7 @@ const Security: FC = () => { <> - + } /> diff --git a/interface/src/framework/security/SecuritySettingsForm.tsx b/interface/src/framework/security/SecuritySettingsForm.tsx index 33d422573..529dd1352 100644 --- a/interface/src/framework/security/SecuritySettingsForm.tsx +++ b/interface/src/framework/security/SecuritySettingsForm.tsx @@ -71,7 +71,7 @@ const SecuritySettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/system/GeneralFileUpload.tsx b/interface/src/framework/system/GeneralFileUpload.tsx index cb3fee48b..8d77657b8 100644 --- a/interface/src/framework/system/GeneralFileUpload.tsx +++ b/interface/src/framework/system/GeneralFileUpload.tsx @@ -93,7 +93,7 @@ const GeneralFileUpload: FC = ({ uploadGeneralFile }) => { diff --git a/interface/src/framework/system/OTASettingsForm.tsx b/interface/src/framework/system/OTASettingsForm.tsx index e5350694f..aa1f36dff 100644 --- a/interface/src/framework/system/OTASettingsForm.tsx +++ b/interface/src/framework/system/OTASettingsForm.tsx @@ -93,7 +93,7 @@ const OTASettingsForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/system/System.tsx b/interface/src/framework/system/System.tsx index 8864bb7d0..2faf986dc 100644 --- a/interface/src/framework/system/System.tsx +++ b/interface/src/framework/system/System.tsx @@ -26,10 +26,10 @@ const System: FC = () => { return ( <> - - + + - {features.ota && } + {features.ota && } {features.upload_firmware && } diff --git a/interface/src/framework/system/SystemLog.tsx b/interface/src/framework/system/SystemLog.tsx index 8d4c2a61f..ace1cd31c 100644 --- a/interface/src/framework/system/SystemLog.tsx +++ b/interface/src/framework/system/SystemLog.tsx @@ -278,7 +278,7 @@ const SystemLog: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/framework/system/SystemStatusForm.tsx b/interface/src/framework/system/SystemStatusForm.tsx index 31c57e7ef..33f6fa47c 100644 --- a/interface/src/framework/system/SystemStatusForm.tsx +++ b/interface/src/framework/system/SystemStatusForm.tsx @@ -129,7 +129,8 @@ const SystemStatusForm: FC = () => { {latestVersion && ( - {LL.THE_LATEST()} {LL.OFFICIAL()} {LL.VERSION_IS()} {latestVersion.version} ( + {LL.THE_LATEST()} {LL.OFFICIAL()} {LL.VERSION_IS()} {latestVersion.version} +  ( {LL.RELEASE_NOTES()} @@ -143,7 +144,8 @@ const SystemStatusForm: FC = () => { {latestDevVersion && ( - {LL.THE_LATEST()} {LL.DEVELOPMENT()} {LL.VERSION_IS()} {latestDevVersion.version} + {LL.THE_LATEST()} {LL.DEVELOPMENT()} {LL.VERSION_IS()}  + {latestDevVersion.version}  ( {LL.RELEASE_NOTES()} @@ -272,12 +274,7 @@ const SystemStatusForm: FC = () => { {data.psram_size !== undefined && data.free_psram !== undefined && ( @@ -305,7 +302,9 @@ const SystemStatusForm: FC = () => { @@ -373,7 +372,7 @@ const SystemStatusForm: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 48191e4c2..4fe930427 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -100,7 +100,8 @@ const de: Translation = { CUSTOMIZATION: 'Anpassungen', APPLICATION_RESTARTING: 'EMS-ESP startet neu', INTERFACE_BOARD_PROFILE: 'Interface Platinenprofil', - BOARD_PROFILE_TEXT: 'Wählen Sie ein vorkonfiguriertes Platinenprofil aus der Liste unten aus oder wählen Sie "Custom", um Ihre eigenen Hardwareeinstellungen zu konfigurieren', + BOARD_PROFILE_TEXT: + 'Wählen Sie ein vorkonfiguriertes Platinenprofil aus der Liste unten aus oder wählen Sie "Custom", um Ihre eigenen Hardwareeinstellungen zu konfigurieren', BOARD_PROFILE: 'Platinenprofil', BUTTON: 'Taste', TEMPERATURE: 'Temperatur', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index fe83b3e2f..e604880ac 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -100,7 +100,8 @@ const en: BaseTranslation = { CUSTOMIZATION: 'Customization', APPLICATION_RESTARTING: 'EMS-ESP is restarting', INTERFACE_BOARD_PROFILE: 'Interface Board Profile', - BOARD_PROFILE_TEXT: 'Select a pre-configured interface board profile from the list below or choose Custom to configure your own hardware settings', + BOARD_PROFILE_TEXT: + 'Select a pre-configured interface board profile from the list below or choose Custom to configure your own hardware settings', BOARD_PROFILE: 'Board Profile', BUTTON: 'Button', TEMPERATURE: 'Temperature', @@ -133,7 +134,7 @@ const en: BaseTranslation = { MARK_INTERVAL: 'Mark Interval', SECONDS: 'seconds', MINUTES: 'minutes', - HOURS: 'hours', + HOURS: 'hours', RESTART: 'Restart', RESTART_TEXT: 'EMS-ESP needs to be restarted to apply changed system settings', RESTART_CONFIRM: 'Are you sure you want to restart EMS-ESP?', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index b8dd40fb3..ccaacc105 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -100,7 +100,8 @@ const nl: Translation = { CUSTOMIZATION: 'Custom aanpassingen', APPLICATION_RESTARTING: 'EMS-ESP herstarten', INTERFACE_BOARD_PROFILE: 'Interface Apparaatprofiel', - BOARD_PROFILE_TEXT: 'Selecteer een vooraf ingesteld apparaat profiel uit de lijst of kies Eigen om zelf uw hardware te configureren', + BOARD_PROFILE_TEXT: + 'Selecteer een vooraf ingesteld apparaat profiel uit de lijst of kies Eigen om zelf uw hardware te configureren', BOARD_PROFILE: 'Apparaatprofiel', BUTTON: 'Toets', TEMPERATURE: 'Temperatuur', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index aa024dab1..002cedb6d 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -100,7 +100,8 @@ const no: Translation = { CUSTOMIZATION: 'Tilpasninger', APPLICATION_RESTARTING: 'EMS-ESP restarter', INTERFACE_BOARD_PROFILE: 'Interface Prosessor Profil', - BOARD_PROFILE_TEXT: 'Velg en pre-konfigurert prosessor profil fra listen under eller velg Tilpasset for å konfigurere dine egne innstillinger', + BOARD_PROFILE_TEXT: + 'Velg en pre-konfigurert prosessor profil fra listen under eller velg Tilpasset for å konfigurere dine egne innstillinger', BOARD_PROFILE: 'Prosessor Profil', BUTTON: 'Knapp', TEMPERATURE: 'Temperatur', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 79f66fa28..b974a6d6a 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -112,7 +112,7 @@ const pl: Translation = { HIDE_LED: 'Wyłącz LED', ENABLE_TELNET: 'Aktywuj dostęp dla konsoli Telnet', ENABLE_ANALOG: 'Aktywuj urządzenia GPIO (czujniki analogowe i cyfrowe oraz wyjścia cyfrowe)', - CONVERT_FAHRENHEIT: "Konwertuj temperatury do skali Fahrenheita", + CONVERT_FAHRENHEIT: 'Konwertuj temperatury do skali Fahrenheita', BYPASS_TOKEN: 'Pomiń autoryzację tokenem w wywołaniach API', READONLY: 'Tryb pracy "tylko do odczytu" (blokuje wszystkie komendy zapisu na magistralę EMS)', UNDERCLOCK_CPU: 'Obniż taktowanie CPU', @@ -159,8 +159,7 @@ const pl: Translation = { HELP_INFORMATION_1: 'W celu znalezienia szczegółowych instrukcji jak skonfigurować EMS-ESP skorzystaj z wiki', HELP_INFORMATION_2: 'W celu komunikacji na żywo ze społecznością skorzystaj z serwera Discord', HELP_INFORMATION_3: 'Aby zaproponować nową funkcjonalność lub zgłosić problem', - HELP_INFORMATION_4: - 'zgłaszając problem, nie zapomnij dołączyć informacji o swoim systemie', + HELP_INFORMATION_4: 'zgłaszając problem, nie zapomnij dołączyć informacji o swoim systemie', HELP_INFORMATION_5: 'EMS-ESP jest darmowym projektem typu open-source. Aby go wesprzeć, rozważ przyznanie nam gwiazdki na Github!', SUPPORT_INFO: 'Pobierz informacje', @@ -179,7 +178,8 @@ const pl: Translation = { CLOSE: 'Zamknij', USE: 'Aby zaktualizować firmware skorzystaj z funkcji', FACTORY_RESET: 'Ustawienia fabryczne', - SYSTEM_FACTORY_TEXT: 'Interfejs EMS-ESP został przywrócony do ustawień fabrycznych i zostanie teraz ponownie uruchomiony.', + SYSTEM_FACTORY_TEXT: + 'Interfejs EMS-ESP został przywrócony do ustawień fabrycznych i zostanie teraz ponownie uruchomiony.', SYSTEM_FACTORY_TEXT_DIALOG: 'Czy jesteś pewien, że chcesz przywrócić ustawienia fabryczne interfejsu EMS-ESP? ', VERSION_CHECK: 'Sprawd{{ź|zanie|}} wersj{{ę|i|}}', THE_LATEST: 'Najnowsza', diff --git a/interface/src/i18n/se/index.ts b/interface/src/i18n/se/index.ts index 9ecc21ba9..9cc334684 100644 --- a/interface/src/i18n/se/index.ts +++ b/interface/src/i18n/se/index.ts @@ -100,7 +100,8 @@ const se: Translation = { CUSTOMIZATION: 'Anpassa', APPLICATION_RESTARTING: 'EMS-ESP startar om', INTERFACE_BOARD_PROFILE: 'Interface Hårdvaruprofil', - BOARD_PROFILE_TEXT: 'Välj en förkonfigurerad hårdvaruprofil från listan nedan eller välj Anpassad för att konfigurera dina egna hårdvaruinställningar', + BOARD_PROFILE_TEXT: + 'Välj en förkonfigurerad hårdvaruprofil från listan nedan eller välj Anpassad för att konfigurera dina egna hårdvaruinställningar', BOARD_PROFILE: 'Hårdvaruprofil', BUTTON: 'Knapp', TEMPERATURE: 'Temperatur', diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index 15c221140..04d0bda83 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -559,11 +559,11 @@ const DashboardData: FC = () => { offset: sensor.o }); if (response.status === 204) { - enqueueSnackbar(LL.UPLOAD_OF( LL.TEMP_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' }); + enqueueSnackbar(LL.UPLOAD_OF(LL.TEMP_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' }); } else if (response.status === 403) { enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' }); } else { - enqueueSnackbar(LL.UPDATED_OF( LL.TEMP_SENSOR() ), { variant: 'success' }); + enqueueSnackbar(LL.UPDATED_OF(LL.TEMP_SENSOR()), { variant: 'success' }); } setSensor(undefined); } catch (error) { @@ -986,11 +986,11 @@ const DashboardData: FC = () => { }); if (response.status === 204) { - enqueueSnackbar(LL.DELETION_OF( LL.ANALOG_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' }); + enqueueSnackbar(LL.DELETION_OF(LL.ANALOG_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' }); } else if (response.status === 403) { enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' }); } else { - enqueueSnackbar( LL.REMOVED_OF( LL.ANALOG_SENSOR() ), { variant: 'success' }); + enqueueSnackbar(LL.REMOVED_OF(LL.ANALOG_SENSOR()), { variant: 'success' }); } } catch (error) { enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' }); @@ -1014,11 +1014,11 @@ const DashboardData: FC = () => { }); if (response.status === 204) { - enqueueSnackbar(LL.UPDATE_OF( LL.ANALOG_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' }); + enqueueSnackbar(LL.UPDATE_OF(LL.ANALOG_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' }); } else if (response.status === 403) { enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' }); } else { - enqueueSnackbar(LL.UPDATED_OF( LL.ANALOG_SENSOR() ), { variant: 'success' }); + enqueueSnackbar(LL.UPDATED_OF(LL.ANALOG_SENSOR()), { variant: 'success' }); } } catch (error) { enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' }); @@ -1077,7 +1077,13 @@ const DashboardData: FC = () => { {analog.t >= AnalogType.COUNTER && analog.t <= AnalogType.RATE && ( <> - + {DeviceValueUOM_s.map((val, i) => ( {val} diff --git a/interface/src/project/DashboardStatus.tsx b/interface/src/project/DashboardStatus.tsx index 254837739..09bd43f6f 100644 --- a/interface/src/project/DashboardStatus.tsx +++ b/interface/src/project/DashboardStatus.tsx @@ -201,7 +201,10 @@ const DashboardStatus: FC = () => { - + diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index 0b1c17a2e..3cfd130f6 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -13,12 +13,12 @@ const Help: FC = () => { const { LL } = useI18nContext(); const { routerTab } = useRouterTab(); - useLayoutTitle(LL.HELP_OF("")); + useLayoutTitle(LL.HELP_OF('')); return ( <> - + } /> diff --git a/interface/src/project/ProjectMenu.tsx b/interface/src/project/ProjectMenu.tsx index bd2602d60..bf2bf57b0 100644 --- a/interface/src/project/ProjectMenu.tsx +++ b/interface/src/project/ProjectMenu.tsx @@ -22,11 +22,11 @@ const ProjectMenu: FC = () => { - + ); }; diff --git a/interface/src/project/Settings.tsx b/interface/src/project/Settings.tsx index e872621ec..580605ccb 100644 --- a/interface/src/project/Settings.tsx +++ b/interface/src/project/Settings.tsx @@ -14,7 +14,7 @@ const Settings: FC = () => { const { LL } = useI18nContext(); const { routerTab } = useRouterTab(); - useLayoutTitle(LL.SETTINGS_OF("")); + useLayoutTitle(LL.SETTINGS_OF('')); return ( <> diff --git a/interface/src/project/SettingsApplication.tsx b/interface/src/project/SettingsApplication.tsx index 86db80855..72ebb7a84 100644 --- a/interface/src/project/SettingsApplication.tsx +++ b/interface/src/project/SettingsApplication.tsx @@ -278,7 +278,7 @@ const SettingsApplication: FC = () => { )} - {LL.SETTINGS_OF("EMS BUS")} + {LL.SETTINGS_OF('EMS BUS')} diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index 93f67360e..562c9faad 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -167,10 +167,7 @@ const SettingsCustomization: FC = () => { function formatName(de: DeviceEntity) { return ( <> - {de.n && ( - (de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' ' - )} - ( + {de.n && (de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '}( {de.id} diff --git a/interface/src/project/validators.ts b/interface/src/project/validators.ts index ea875c03f..6000e0769 100644 --- a/interface/src/project/validators.ts +++ b/interface/src/project/validators.ts @@ -24,10 +24,7 @@ export const GPIO_VALIDATOR = { export const GPIO_VALIDATORC3 = { validator(rule: InternalRuleItem, value: number, callback: (error?: string) => void) { - if ( - value && - ((value >= 11 && value <= 19) || value > 21 || value < 0) - ) { + if (value && ((value >= 11 && value <= 19) || value > 21 || value < 0)) { callback('Must be an valid GPIO port'); } else { callback(); @@ -37,10 +34,7 @@ export const GPIO_VALIDATORC3 = { export const GPIO_VALIDATORS2 = { validator(rule: InternalRuleItem, value: number, callback: (error?: string) => void) { - if ( - value && - ((value >= 19 && value <= 20) || (value >= 22 && value <= 32) || value > 40 || value < 0) - ) { + if (value && ((value >= 19 && value <= 20) || (value >= 22 && value <= 32) || value > 40 || value < 0)) { callback('Must be an valid GPIO port'); } else { callback(); @@ -50,27 +44,30 @@ export const GPIO_VALIDATORS2 = { export const createSettingsValidator = (settings: Settings) => new Schema({ - ...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32' && { - led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATOR], - dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATOR], - pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATOR], - tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATOR], - rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR] - }), - ...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32-C3' && { - led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORC3], - dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORC3], - pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORC3], - tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORC3], - rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORC3] - }), - ...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32-S2' && { - led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORS2], - dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORS2], - pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORS2], - tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORS2], - rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORS2] - }), + ...(settings.board_profile === 'CUSTOM' && + settings.platform === 'ESP32' && { + led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATOR], + dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATOR], + pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATOR], + tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATOR], + rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR] + }), + ...(settings.board_profile === 'CUSTOM' && + settings.platform === 'ESP32-C3' && { + led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORC3], + dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORC3], + pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORC3], + tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORC3], + rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORC3] + }), + ...(settings.board_profile === 'CUSTOM' && + settings.platform === 'ESP32-S2' && { + led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORS2], + dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORS2], + pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORS2], + tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORS2], + rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORS2] + }), ...(settings.syslog_enabled && { syslog_host: [{ required: true, message: 'Host is required' }, IP_OR_HOSTNAME_VALIDATOR], syslog_port: [ diff --git a/interface/src/utils/useRest.ts b/interface/src/utils/useRest.ts index 692f354b3..8b9c6edee 100644 --- a/interface/src/utils/useRest.ts +++ b/interface/src/utils/useRest.ts @@ -47,7 +47,7 @@ export const useRest = ({ read, update }: RestRequestOptions) => { if (response.status === 202) { setRestartNeeded(true); } else { - enqueueSnackbar(LL.SETTINGS_OF("") + ' ' + LL.SAVED(), { variant: 'success' }); + enqueueSnackbar(LL.SETTINGS_OF('') + ' ' + LL.SAVED(), { variant: 'success' }); } } catch (error) { const message = extractErrorMessage(error, LL.PROBLEM_UPDATING());