diff --git a/interface/src/app/main/Sensors.tsx b/interface/src/app/main/Sensors.tsx index 22a629ff2..bbb8fd636 100644 --- a/interface/src/app/main/Sensors.tsx +++ b/interface/src/app/main/Sensors.tsx @@ -96,6 +96,7 @@ const common_theme = { } &:hover .td { background-color: #177ac9; + color: white; } `, Cell: ` @@ -297,7 +298,12 @@ const Sensors = () => { const onTemperatureDialogSave = useCallback( async (ts: TemperatureSensor) => { - await sendTemperatureSensor({ id: ts.id, name: ts.n, offset: ts.o }) + await sendTemperatureSensor({ + id: ts.id, + name: ts.n, + offset: ts.o, + is_system: ts.s + }) .then(() => { toast.success(LL.UPDATED_OF(LL.SENSOR(1))); }) @@ -342,7 +348,8 @@ const Sensors = () => { t: 0, f: 1, d: false, - o_n: '' + o_n: '', + s: false }); setAnalogDialogOpen(true); }, []); @@ -357,7 +364,8 @@ const Sensors = () => { factor: as.f, uom: as.u, type: as.t, - deleted: as.d + deleted: as.d, + is_system: as.s }) .then(() => { toast.success(LL.UPDATED_OF(LL.ANALOG_SENSOR(2))); @@ -431,20 +439,25 @@ const Sensors = () => { - {tableList.map((a: AnalogSensor) => ( - updateAnalogSensor(a)}> - {a.g} - {a.n} - {AnalogTypeNames[a.t]} - {(a.t === AnalogType.DIGITAL_OUT && - a.g !== GPIO_25 && - a.g !== GPIO_26) || - a.t === AnalogType.DIGITAL_IN || - a.t === AnalogType.PULSE ? ( - {a.v ? LL.ON() : LL.OFF()} + {tableList.map((as: AnalogSensor) => ( + updateAnalogSensor(as)} + > + {as.g} + {as.n} + {AnalogTypeNames[as.t]} + {(as.t === AnalogType.DIGITAL_OUT && + as.g !== GPIO_25 && + as.g !== GPIO_26) || + as.t === AnalogType.DIGITAL_IN || + as.t === AnalogType.PULSE ? ( + {as.v ? LL.ON() : LL.OFF()} ) : ( - {a.t !== AnalogType.NOTUSED ? formatValue(a.v, a.u) : ''} + {as.t !== AnalogType.NOTUSED ? formatValue(as.v, as.u) : ''} )} @@ -506,6 +519,7 @@ const Sensors = () => { {tableList.map((ts: TemperatureSensor) => ( updateTemperatureSensor(ts)} diff --git a/interface/src/app/main/SensorsAnalogDialog.tsx b/interface/src/app/main/SensorsAnalogDialog.tsx index fbbd35466..ee5087d12 100644 --- a/interface/src/app/main/SensorsAnalogDialog.tsx +++ b/interface/src/app/main/SensorsAnalogDialog.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import CancelIcon from '@mui/icons-material/Cancel'; +import DoneIcon from '@mui/icons-material/Done'; import RemoveIcon from '@mui/icons-material/RemoveCircleOutline'; import WarningIcon from '@mui/icons-material/Warning'; import { @@ -441,6 +442,18 @@ const SensorsAnalogDialog = ({ )} + {editItem.s && ( + + + + {LL.SYSTEM(0)} {LL.SENSOR(0)} + + + )} {!creating && ( @@ -465,7 +478,7 @@ const SensorsAnalogDialog = ({ {LL.CANCEL()}