diff --git a/interface/src/framework/mqtt/MqttSettingsForm.tsx b/interface/src/framework/mqtt/MqttSettingsForm.tsx index 8cc8c0064..1eecf0b55 100644 --- a/interface/src/framework/mqtt/MqttSettingsForm.tsx +++ b/interface/src/framework/mqtt/MqttSettingsForm.tsx @@ -135,7 +135,7 @@ const MqttSettingsForm: FC = () => { name="keep_alive" label="Keep Alive" InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -243,7 +243,7 @@ const MqttSettingsForm: FC = () => { name="publish_time_boiler" label={LL.MQTT_INT_BOILER()} InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -259,7 +259,7 @@ const MqttSettingsForm: FC = () => { name="publish_time_thermostat" label={LL.MQTT_INT_THERMOSTATS()} InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -275,7 +275,7 @@ const MqttSettingsForm: FC = () => { name="publish_time_solar" label={LL.MQTT_INT_SOLAR()} InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -291,7 +291,7 @@ const MqttSettingsForm: FC = () => { name="publish_time_mixer" label={LL.MQTT_INT_MIXER()} InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -307,7 +307,7 @@ const MqttSettingsForm: FC = () => { name="publish_time_sensor" label={LL.TEMP_SENSORS()} InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -322,7 +322,7 @@ const MqttSettingsForm: FC = () => { fieldErrors={fieldErrors} name="publish_time_other" InputProps={{ - endAdornment: seconds + endAdornment: {LL.SECONDS()} }} label={LL.DEFAULT()} fullWidth diff --git a/interface/src/framework/system/GeneralFileUpload.tsx b/interface/src/framework/system/GeneralFileUpload.tsx index 8da4835ef..d301e517f 100644 --- a/interface/src/framework/system/GeneralFileUpload.tsx +++ b/interface/src/framework/system/GeneralFileUpload.tsx @@ -70,21 +70,23 @@ const GeneralFileUpload: FC = ({ uploadGeneralFile }) => { return ( <> - - {LL.UPLOAD()} - {!uploading && ( - - {LL.UPLOAD_TEXT()} - + <> + + {LL.UPLOAD()} + + + {LL.UPLOAD_TEXT()} + + )} - - {LL.DOWNLOAD()} - {!uploading && ( <> + + {LL.DOWNLOAD()} + {LL.DOWNLOAD_SETTINGS_TEXT()} diff --git a/interface/src/framework/system/SystemStatusForm.tsx b/interface/src/framework/system/SystemStatusForm.tsx index ffd889fa9..29f9e0893 100644 --- a/interface/src/framework/system/SystemStatusForm.tsx +++ b/interface/src/framework/system/SystemStatusForm.tsx @@ -104,7 +104,7 @@ const SystemStatusForm: FC = () => { onClick={() => setConfirmRestart(false)} color="secondary" > - Cancel + {LL.CANCEL()} @@ -242,7 +242,7 @@ const SystemStatusForm: FC = () => { - + @@ -251,7 +251,7 @@ const SystemStatusForm: FC = () => { - + @@ -260,7 +260,7 @@ const SystemStatusForm: FC = () => { - + @@ -270,7 +270,7 @@ const SystemStatusForm: FC = () => { { @@ -304,7 +304,7 @@ const SystemStatusForm: FC = () => { { /** + * Analog Sensors + */ + ANALOG_SENSORS: string + /** * Temperature Sensor{post} * @param {unknown} post */ @@ -464,8 +468,12 @@ type RootTranslation = { */ MINUTES: string /** - * Restart + * hours */ + HOURS: string + /** + * Restart + */ RESTART: string /** * EMS-ESP needs to be restarted to apply changed system settings @@ -656,8 +664,36 @@ type RootTranslation = { */ THE_LATEST: string /** - * Buffer Size + * Device (Platform / SDK) */ + PLATFORM: string + /** + * System Uptime + */ + UPTIME: string + /** + * CPU Frequency + */ + CPU_FREQ: string + /** + * Heap (Free / Max Alloc) + */ + HEAP: string + /** + * PSRAM (Size / Free) + */ + PSRAM: string + /** + * Flash Chip (Size / Speed) + */ + FLASH: string + /** + * File System (Used / Total) + */ + FILESYSTEM: string + /** + * Buffer Size + */ BUFFER_SIZE: string /** * Compact @@ -1127,6 +1163,10 @@ export type TranslationFunctions = { */ ANALOG_SENSOR: (arg: { post: unknown }) => LocalizedString /** + * Analog Sensors + */ + ANALOG_SENSORS: () => LocalizedString + /** * Temperature Sensor{post} */ TEMP_SENSOR: (arg: { post: unknown }) => LocalizedString @@ -1393,8 +1433,12 @@ export type TranslationFunctions = { */ MINUTES: () => LocalizedString /** - * Restart + * hours */ + HOURS: () => LocalizedString + /** + * Restart + */ RESTART: () => LocalizedString /** * EMS-ESP needs to be restarted to apply changed system settings @@ -1584,6 +1628,34 @@ export type TranslationFunctions = { * The latest */ THE_LATEST: () => LocalizedString + /** + * Device (Platform / SDK) + */ + PLATFORM: () => LocalizedString + /** + * ystem Uptime + */ + UPTIME: () => LocalizedString + /** + * CPU Frequency + */ + CPU_FREQ: () => LocalizedString + /** + * Heap (Free / Max Alloc) + */ + HEAP: () => LocalizedString + /** + * PSRAM (Size / Free) + */ + PSRAM: () => LocalizedString + /** + * Flash Chip (Size / Speed) + */ + FLASH: () => LocalizedString + /** + * File System (Used / Total) + */ + FILESYSTEM: () => LocalizedString /** * Buffer Size */ diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index d07c7b442..bfe716de2 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -420,9 +420,9 @@ const DashboardData: FC = () => { } switch (uom) { case DeviceValueUOM.HOURS: - return formatDurationMin(value * 60); + return value ? formatDurationMin(value * 60) : LL.NUM_HOURS({ num: 0 }); case DeviceValueUOM.MINUTES: - return formatDurationMin(value); + return value ? formatDurationMin(value) : LL.NUM_MINUTES({ num: 0 }); case DeviceValueUOM.SECONDS: return LL.NUM_SECONDS({ num: value }); case DeviceValueUOM.NONE: @@ -445,6 +445,19 @@ const DashboardData: FC = () => { } } + const setUom = (uom: number) => { + switch (uom) { + case DeviceValueUOM.HOURS: + return LL.HOURS(); + case DeviceValueUOM.MINUTES: + return LL.MINUTES(); + case DeviceValueUOM.SECONDS: + return LL.SECONDS(); + default: + return DeviceValueUOM_s[uom]; + } + }; + const sendDeviceValue = async () => { if (deviceValue) { try { @@ -502,7 +515,7 @@ const DashboardData: FC = () => { onChange={updateValue(setDeviceValue)} inputProps={deviceValue.u ? { min: deviceValue.m, max: deviceValue.x, step: deviceValue.s } : {}} InputProps={{ - startAdornment: {DeviceValueUOM_s[deviceValue.u]} + startAdornment: {setUom(deviceValue.u)} }} /> )} @@ -833,7 +846,7 @@ const DashboardData: FC = () => { const renderDallasData = () => ( <> - Temperature Sensors + {LL.TEMP_SENSORS()} { endIcon={getSortIcon(sensor_sort.state, 'NAME')} onClick={() => sensor_sort.fns.onToggleSort({ sortKey: 'NAME' })} > - NAME + {LL.ENTITY_NAME()} @@ -862,7 +875,7 @@ const DashboardData: FC = () => { endIcon={getSortIcon(sensor_sort.state, 'TEMPERATURE')} onClick={() => sensor_sort.fns.onToggleSort({ sortKey: 'TEMPERATURE' })} > - TEMPERATURE + {LL.VALUE()} @@ -892,7 +905,7 @@ const DashboardData: FC = () => { const renderAnalogData = () => ( <> - Analog Sensors + {LL.ANALOG_SENSORS()}
@@ -917,7 +930,7 @@ const DashboardData: FC = () => { endIcon={getSortIcon(analog_sort.state, 'NAME')} onClick={() => analog_sort.fns.onToggleSort({ sortKey: 'NAME' })} > - NAME + {LL.ENTITY_NAME()} @@ -927,7 +940,7 @@ const DashboardData: FC = () => { endIcon={getSortIcon(analog_sort.state, 'TYPE')} onClick={() => analog_sort.fns.onToggleSort({ sortKey: 'TYPE' })} > - TYPE + {LL.TYPE()} VALUE @@ -1034,7 +1047,7 @@ const DashboardData: FC = () => { { /> - + {AnalogTypeNames.map((val, i) => ( {val} @@ -1127,7 +1140,7 @@ const DashboardData: FC = () => {