mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
fix formatting for ranges not showing
This commit is contained in:
@@ -89,27 +89,16 @@ const DashboardDevicesDialog = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showHelperText = (dv: DeviceValue) => {
|
const showHelperText = (dv: DeviceValue) =>
|
||||||
if (dv.h) {
|
dv.h ? (
|
||||||
return dv.h;
|
dv.h
|
||||||
}
|
) : dv.l ? (
|
||||||
if (dv.l) {
|
dv.l.join(' | ')
|
||||||
return '[ ' + dv.l.join(' | ') + ' ]';
|
) : dv.m !== undefined && dv.x !== undefined ? (
|
||||||
}
|
<>
|
||||||
|
{dv.m} → {dv.x}
|
||||||
let helperText = '<';
|
</>
|
||||||
if (dv.s) {
|
) : undefined;
|
||||||
helperText += 'n';
|
|
||||||
if (dv.m !== undefined && dv.x !== undefined) {
|
|
||||||
helperText += ' between ' + dv.m + ' and ' + dv.x;
|
|
||||||
} else {
|
|
||||||
helperText += ' , step ' + dv.s;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
helperText += 'text';
|
|
||||||
}
|
|
||||||
return helperText + '>';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||||
@@ -171,7 +160,7 @@ const DashboardDevicesDialog = ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
{writeable && (
|
{writeable && (
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<FormHelperText>format: {showHelperText(editItem)}</FormHelperText>
|
<FormHelperText>{showHelperText(editItem)}</FormHelperText>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user