Merge branch 'dev' into dev

This commit is contained in:
Proddy
2022-11-20 20:55:24 +01:00
committed by GitHub
15 changed files with 194 additions and 40 deletions

View File

@@ -86,8 +86,10 @@ const SystemStatusForm: FC = () => {
const restart = async () => {
setProcessing(true);
try {
await SystemApi.restart();
setRestarting(true);
const response = await SystemApi.restart();
if (response.status === 200) {
setRestarting(true);
}
} catch (error) {
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_LOADING()), { variant: 'error' });
} finally {
@@ -208,7 +210,7 @@ const SystemStatusForm: FC = () => {
setProcessing(true);
try {
await SystemApi.factoryReset();
enqueueSnackbar(LL.SYSTEM_FACTORY_TEXT(), { variant: 'info' });
setRestarting(true);
} catch (error) {
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
} finally {

View File

@@ -9,6 +9,8 @@ import { GiHeatHaze } from 'react-icons/gi';
import { TiFlowSwitch } from 'react-icons/ti';
import { VscVmConnect } from 'react-icons/vsc';
import { AiOutlineGateway } from 'react-icons/ai';
import { AiOutlineAlert } from 'react-icons/ai';
import { AiOutlineChrome } from 'react-icons/ai';
interface DeviceIconProps {
type: string;
@@ -34,6 +36,10 @@ const DeviceIcon: FC<DeviceIconProps> = ({ type }) => {
return <VscVmConnect />;
case 'Gateway':
return <AiOutlineGateway />;
case 'Alert':
return <AiOutlineAlert />;
case 'Pump':
return <AiOutlineChrome />;
default:
return null;
}

View File

@@ -192,7 +192,7 @@ export const DeviceValueUOM_s = [
'Wh',
'hours',
'minutes',
'uA',
'µA',
'bar',
'kW',
'W',
@@ -201,8 +201,8 @@ export const DeviceValueUOM_s = [
'dBm',
'°F',
'mV',
'sqm',
'm3',
'm²',
'm³',
'l'
];