From 97f9914d3392648718ec333444d0ccf5a8b96ff6 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 23 Nov 2025 20:32:25 +0100 Subject: [PATCH] grey out entities with no value --- interface/src/app/main/Customizations.tsx | 39 ++++++++++++++++------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/interface/src/app/main/Customizations.tsx b/interface/src/app/main/Customizations.tsx index b5ea9823c..a387774cc 100644 --- a/interface/src/app/main/Customizations.tsx +++ b/interface/src/app/main/Customizations.tsx @@ -285,13 +285,17 @@ const Customizations = () => { return value as string; } + const isCommand = useCallback((de: DeviceEntity) => { + return de.n && de.n[0] === '!'; + }, []); + const formatName = useCallback( (de: DeviceEntity, withShortname: boolean) => { let name: string; - if (de.n && de.n[0] === '!') { + if (isCommand(de)) { name = de.t - ? `${LL.COMMAND(1)}: ${de.t} ${de.n.slice(1)}` - : `${LL.COMMAND(1)}: ${de.n.slice(1)}`; + ? `${LL.COMMAND(1)}: ${de.t} ${de.n?.slice(1)}` + : `${LL.COMMAND(1)}: ${de.n?.slice(1)}`; } else if (de.cn && de.cn !== '') { name = de.t ? `${de.t} ${de.cn}` : de.cn; } else { @@ -543,7 +547,7 @@ const Customizations = () => { return ( <> - + ={LL.CUSTOMIZATIONS_HELP_2()}    ={LL.CUSTOMIZATIONS_HELP_3()} @@ -666,14 +670,27 @@ const Customizations = () => { - {formatName(de, false)} ( - - {de.id} - - ) + {formatName(de, false)} ( + + {de.id} + + ) + {!(de.m & DeviceEntityMask.DV_READONLY) && formatValue(de.mi)}