mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
added formatName so hidden entities render nicely
This commit is contained in:
@@ -199,6 +199,13 @@ const SettingsCustomization: FC = () => {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatName(de: DeviceEntity) {
|
||||||
|
if (de.id == de.s) {
|
||||||
|
return de.s;
|
||||||
|
}
|
||||||
|
return de.id + ' (' + de.s + ')';
|
||||||
|
}
|
||||||
|
|
||||||
const getMaskNumber = (newMask: string[]) => {
|
const getMaskNumber = (newMask: string[]) => {
|
||||||
var new_mask = 0;
|
var new_mask = 0;
|
||||||
for (let entry of newMask) {
|
for (let entry of newMask) {
|
||||||
@@ -403,7 +410,7 @@ const SettingsCustomization: FC = () => {
|
|||||||
<VisibilityOffOutlinedIcon color="primary" sx={{ fontSize: 14, verticalAlign: 'middle' }} />:
|
<VisibilityOffOutlinedIcon color="primary" sx={{ fontSize: 14, verticalAlign: 'middle' }} />:
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Tooltip arrow placement="top" title="mark shown entities to be all visible and output ">
|
<Tooltip arrow placement="top" title="set shown entities to be all visible and output">
|
||||||
<Button
|
<Button
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ fontSize: 10 }}
|
sx={{ fontSize: 10 }}
|
||||||
@@ -416,7 +423,7 @@ const SettingsCustomization: FC = () => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Tooltip arrow placement="top" title="mark shown entities to be not visible or output ">
|
<Tooltip arrow placement="top" title="set shown entities to be not visible or output">
|
||||||
<Button
|
<Button
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ fontSize: 10 }}
|
sx={{ fontSize: 10 }}
|
||||||
@@ -464,7 +471,7 @@ const SettingsCustomization: FC = () => {
|
|||||||
setMasks(['']);
|
setMasks(['']);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ToggleButton value="8" disabled={(de.m & 1) !== 0 || de.id === ''}>
|
<ToggleButton value="8" disabled={(de.m & 1) !== 0 || de.id === '' || de.s === de.id}>
|
||||||
<StarIcon sx={{ fontSize: 14 }} />
|
<StarIcon sx={{ fontSize: 14 }} />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<ToggleButton value="4" disabled={!de.w || (de.m & 3) === 3}>
|
<ToggleButton value="4" disabled={!de.w || (de.m & 3) === 3}>
|
||||||
@@ -473,14 +480,12 @@ const SettingsCustomization: FC = () => {
|
|||||||
<ToggleButton value="2">
|
<ToggleButton value="2">
|
||||||
<CommentsDisabledOutlinedIcon sx={{ fontSize: 14 }} />
|
<CommentsDisabledOutlinedIcon sx={{ fontSize: 14 }} />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<ToggleButton value="1">
|
<ToggleButton value="1" disabled={de.s === de.id}>
|
||||||
<VisibilityOffOutlinedIcon sx={{ fontSize: 14 }} />
|
<VisibilityOffOutlinedIcon sx={{ fontSize: 14 }} />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</ToggleButtonGroup>
|
</ToggleButtonGroup>
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>{formatName(de)}</Cell>
|
||||||
{de.id} ({de.s})
|
|
||||||
</Cell>
|
|
||||||
<Cell>{formatValue(de.v)}</Cell>
|
<Cell>{formatValue(de.v)}</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user