From fadb03ad27bf9a7a89586d0149808aca6f8a69ad Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Tue, 17 Mar 2026 09:12:01 -0700
Subject: [PATCH] Enhancement: better support for raw values in block
highlighting (#6434)
---
src/components/services/widget/block.jsx | 6 +--
src/components/services/widget/block.test.jsx | 23 +++++++++
src/widgets/adguard/component.jsx | 1 +
src/widgets/beszel/component.jsx | 19 ++++++--
src/widgets/deluge/component.jsx | 4 +-
src/widgets/docker/component.jsx | 10 ++--
src/widgets/dockhand/component.jsx | 12 ++++-
src/widgets/downloadstation/component.jsx | 4 +-
src/widgets/filebrowser/component.jsx | 15 ++++--
src/widgets/flood/component.jsx | 4 +-
src/widgets/fritzbox/component.jsx | 36 +++++++++++---
src/widgets/gamedig/component.jsx | 2 +-
src/widgets/gatus/component.jsx | 2 +-
src/widgets/jdownloader/component.jsx | 13 ++++-
src/widgets/kubernetes/component.jsx | 13 ++++-
src/widgets/mikrotik/component.jsx | 12 ++++-
src/widgets/myspeed/component.jsx | 1 +
src/widgets/nextcloud/component.jsx | 15 +++++-
src/widgets/nzbget/component.jsx | 13 ++++-
src/widgets/openwrt/methods/interface.jsx | 4 +-
src/widgets/opnsense/component.jsx | 18 +++++--
src/widgets/peanut/component.jsx | 12 ++++-
src/widgets/pfsense/component.jsx | 15 +++++-
src/widgets/proxmox/component.jsx | 12 ++++-
src/widgets/proxmoxbackupserver/component.jsx | 18 +++++--
src/widgets/proxmoxvm/component.jsx | 8 +++-
src/widgets/pyload/component.jsx | 6 ++-
src/widgets/qbittorrent/component.jsx | 12 ++++-
src/widgets/rutorrent/component.jsx | 4 +-
src/widgets/speedtest/component.jsx | 1 +
src/widgets/strelaysrv/component.jsx | 7 ++-
src/widgets/tdarr/component.jsx | 2 +-
src/widgets/transmission/component.jsx | 4 +-
src/widgets/unraid/component.jsx | 48 ++++++++++++++-----
src/widgets/uptimekuma/component.jsx | 2 +-
35 files changed, 300 insertions(+), 78 deletions(-)
diff --git a/src/components/services/widget/block.jsx b/src/components/services/widget/block.jsx
index c61dd5d5..e78123ea 100644
--- a/src/components/services/widget/block.jsx
+++ b/src/components/services/widget/block.jsx
@@ -6,7 +6,7 @@ import { BlockHighlightContext } from "./highlight-context";
import { evaluateHighlight, getHighlightClass } from "utils/highlights";
-export default function Block({ value, label, field }) {
+export default function Block({ value, highlightValue, label, field }) {
const { t } = useTranslation();
const highlightConfig = useContext(BlockHighlightContext);
@@ -20,12 +20,12 @@ export default function Block({ value, label, field }) {
}
for (const candidate of candidates) {
- const result = evaluateHighlight(candidate, value, highlightConfig);
+ const result = evaluateHighlight(candidate, highlightValue ?? value, highlightConfig);
if (result) return result;
}
return null;
- }, [field, label, value, highlightConfig]);
+ }, [field, label, value, highlightValue, highlightConfig]);
const highlightClass = useMemo(() => {
if (!highlight?.level) return undefined;
diff --git a/src/components/services/widget/block.test.jsx b/src/components/services/widget/block.test.jsx
index ece7518a..38ee0d13 100644
--- a/src/components/services/widget/block.test.jsx
+++ b/src/components/services/widget/block.test.jsx
@@ -38,4 +38,27 @@ describe("components/services/widget/block", () => {
expect(el.getAttribute("data-highlight-level")).toBe("danger");
expect(el.className).toContain("danger-class");
});
+
+ it("prefers highlightValue over the rendered value for numeric highlighting", () => {
+ const highlightConfig = {
+ levels: { warn: "warn-class" },
+ fields: {
+ foo: {
+ numeric: { when: "gt", value: 5, level: "warn" },
+ },
+ },
+ };
+
+ const { container } = renderWithProviders(
+
+
+ ,
+ { settings: {} },
+ );
+
+ const el = container.querySelector(".service-block");
+ expect(el).not.toBeNull();
+ expect(el.getAttribute("data-highlight-level")).toBe("warn");
+ expect(el.className).toContain("warn-class");
+ });
});
diff --git a/src/widgets/adguard/component.jsx b/src/widgets/adguard/component.jsx
index e5a7670a..47980e11 100644
--- a/src/widgets/adguard/component.jsx
+++ b/src/widgets/adguard/component.jsx
@@ -37,6 +37,7 @@ export default function Component({ service }) {
);
diff --git a/src/widgets/beszel/component.jsx b/src/widgets/beszel/component.jsx
index bbcaeb0b..18ed67d2 100644
--- a/src/widgets/beszel/component.jsx
+++ b/src/widgets/beszel/component.jsx
@@ -51,12 +51,25 @@ export default function Component({ service }) {
-
-
-
+
+
+
);
diff --git a/src/widgets/deluge/component.jsx b/src/widgets/deluge/component.jsx
index eb6ddfaa..1707eb6c 100644
--- a/src/widgets/deluge/component.jsx
+++ b/src/widgets/deluge/component.jsx
@@ -52,9 +52,9 @@ export default function Component({ service }) {
<>
-
+
-
+
{widget?.enableLeechProgress &&
leechTorrents.map((queueEntry) => (
diff --git a/src/widgets/docker/component.jsx b/src/widgets/docker/component.jsx
index 6e05454f..b1d8e125 100644
--- a/src/widgets/docker/component.jsx
+++ b/src/widgets/docker/component.jsx
@@ -41,17 +41,19 @@ export default function Component({ service }) {
}
const { rxBytes, txBytes } = calculateThroughput(statsData.stats);
+ const cpuPercent = calculateCPUPercent(statsData.stats);
+ const usedMemory = calculateUsedMemory(statsData.stats);
return (
-
+
{statsData.stats.memory_stats.usage && (
-
+
)}
{statsData.stats.networks && (
<>
-
-
+
+
>
)}
diff --git a/src/widgets/dockhand/component.jsx b/src/widgets/dockhand/component.jsx
index 50ccff18..d3c97bd0 100644
--- a/src/widgets/dockhand/component.jsx
+++ b/src/widgets/dockhand/component.jsx
@@ -105,8 +105,16 @@ export default function Component({ service }) {
-
-
+
+
-
+
-
+
);
}
diff --git a/src/widgets/filebrowser/component.jsx b/src/widgets/filebrowser/component.jsx
index cf5a2800..53b6d89b 100644
--- a/src/widgets/filebrowser/component.jsx
+++ b/src/widgets/filebrowser/component.jsx
@@ -25,14 +25,21 @@ export default function Component({ service }) {
);
}
+ const available = (usage?.total ?? 0) - (usage?.used ?? 0);
+
return (
+
+
-
-
);
}
diff --git a/src/widgets/flood/component.jsx b/src/widgets/flood/component.jsx
index 92a2b61a..973f8a6f 100644
--- a/src/widgets/flood/component.jsx
+++ b/src/widgets/flood/component.jsx
@@ -45,9 +45,9 @@ export default function Component({ service }) {
return (
-
+
-
+
);
}
diff --git a/src/widgets/fritzbox/component.jsx b/src/widgets/fritzbox/component.jsx
index d7928c20..40597505 100644
--- a/src/widgets/fritzbox/component.jsx
+++ b/src/widgets/fritzbox/component.jsx
@@ -47,12 +47,36 @@ export default function Component({ service }) {
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/widgets/gamedig/component.jsx b/src/widgets/gamedig/component.jsx
index b76002b5..2efea563 100644
--- a/src/widgets/gamedig/component.jsx
+++ b/src/widgets/gamedig/component.jsx
@@ -58,7 +58,7 @@ export default function Component({ service }) {
-
+
);
}
diff --git a/src/widgets/gatus/component.jsx b/src/widgets/gatus/component.jsx
index 25aae239..3a30b7e2 100644
--- a/src/widgets/gatus/component.jsx
+++ b/src/widgets/gatus/component.jsx
@@ -45,7 +45,7 @@ export default function Component({ service }) {
-
+
);
}
diff --git a/src/widgets/jdownloader/component.jsx b/src/widgets/jdownloader/component.jsx
index a7722c7c..c352902e 100644
--- a/src/widgets/jdownloader/component.jsx
+++ b/src/widgets/jdownloader/component.jsx
@@ -31,12 +31,21 @@ export default function Component({ service }) {
return (
-
+
+
-
);
}
diff --git a/src/widgets/kubernetes/component.jsx b/src/widgets/kubernetes/component.jsx
index d3587a59..e008411e 100644
--- a/src/widgets/kubernetes/component.jsx
+++ b/src/widgets/kubernetes/component.jsx
@@ -43,14 +43,23 @@ export default function Component({ service }) {
return (
{(statsData.stats.cpuLimit && (
-
+
)) || (
)}
-
+
);
}
diff --git a/src/widgets/mikrotik/component.jsx b/src/widgets/mikrotik/component.jsx
index 4bab6792..fd7365d8 100644
--- a/src/widgets/mikrotik/component.jsx
+++ b/src/widgets/mikrotik/component.jsx
@@ -35,8 +35,16 @@ export default function Component({ service }) {
return (
-
-
+
+
);
diff --git a/src/widgets/myspeed/component.jsx b/src/widgets/myspeed/component.jsx
index e0967d47..8db5ecd0 100644
--- a/src/widgets/myspeed/component.jsx
+++ b/src/widgets/myspeed/component.jsx
@@ -54,6 +54,7 @@ export default function Component({ service }) {
style: "unit",
unit: "millisecond",
})}
+ highlightValue={data[0].ping}
/>
);
diff --git a/src/widgets/nextcloud/component.jsx b/src/widgets/nextcloud/component.jsx
index d1f1cac9..fe78bf3d 100755
--- a/src/widgets/nextcloud/component.jsx
+++ b/src/widgets/nextcloud/component.jsx
@@ -56,12 +56,23 @@ export default function Component({ service }) {
return (
{showCpuLoad && (
-
+
+ )}
+ {showMemoryUsage && (
+
)}
- {showMemoryUsage && }
diff --git a/src/widgets/nzbget/component.jsx b/src/widgets/nzbget/component.jsx
index a11ac9da..401010f8 100644
--- a/src/widgets/nzbget/component.jsx
+++ b/src/widgets/nzbget/component.jsx
@@ -27,11 +27,20 @@ export default function Component({ service }) {
return (
-
-
+
+
);
diff --git a/src/widgets/openwrt/methods/interface.jsx b/src/widgets/openwrt/methods/interface.jsx
index b746bc7e..99e66ea2 100644
--- a/src/widgets/openwrt/methods/interface.jsx
+++ b/src/widgets/openwrt/methods/interface.jsx
@@ -21,8 +21,8 @@ export default function Component({ service }) {
return (
-
-
+
+
);
}
diff --git a/src/widgets/opnsense/component.jsx b/src/widgets/opnsense/component.jsx
index 1caaab47..17c765fc 100644
--- a/src/widgets/opnsense/component.jsx
+++ b/src/widgets/opnsense/component.jsx
@@ -36,10 +36,22 @@ export default function Component({ service }) {
return (
-
+
- {wan && }
- {wan && }
+ {wan && (
+
+ )}
+ {wan && (
+
+ )}
);
}
diff --git a/src/widgets/peanut/component.jsx b/src/widgets/peanut/component.jsx
index 54a293ad..f2c8491d 100644
--- a/src/widgets/peanut/component.jsx
+++ b/src/widgets/peanut/component.jsx
@@ -52,8 +52,16 @@ export default function Component({ service }) {
return (
-
-
+
+
);
diff --git a/src/widgets/pfsense/component.jsx b/src/widgets/pfsense/component.jsx
index 69a862b4..06285ed7 100644
--- a/src/widgets/pfsense/component.jsx
+++ b/src/widgets/pfsense/component.jsx
@@ -51,14 +51,25 @@ export default function Component({ service }) {
label="pfsense.load"
value={version === 1 ? systemData.data.load_avg[0] : systemData.data.cpu_load_avg[0]}
/>
-
+
{showWanIP && }
- {showDiskUsage && }
+ {showDiskUsage && (
+
+ )}
);
}
diff --git a/src/widgets/proxmox/component.jsx b/src/widgets/proxmox/component.jsx
index 51762a73..ddab5bc5 100644
--- a/src/widgets/proxmox/component.jsx
+++ b/src/widgets/proxmox/component.jsx
@@ -67,8 +67,16 @@ export default function Component({ service }) {
-
-
+
+
);
}
diff --git a/src/widgets/proxmoxbackupserver/component.jsx b/src/widgets/proxmoxbackupserver/component.jsx
index b13f8756..0af1134b 100644
--- a/src/widgets/proxmoxbackupserver/component.jsx
+++ b/src/widgets/proxmoxbackupserver/component.jsx
@@ -47,10 +47,22 @@ export default function Component({ service }) {
return (
-
+
-
-
+
+
);
}
diff --git a/src/widgets/proxmoxvm/component.jsx b/src/widgets/proxmoxvm/component.jsx
index 75593642..4cc0f873 100644
--- a/src/widgets/proxmoxvm/component.jsx
+++ b/src/widgets/proxmoxvm/component.jsx
@@ -25,8 +25,12 @@ export default function ProxmoxVM({ service }) {
return (
-
-
+
+
);
}
diff --git a/src/widgets/pyload/component.jsx b/src/widgets/pyload/component.jsx
index f618f75e..13ee32a9 100644
--- a/src/widgets/pyload/component.jsx
+++ b/src/widgets/pyload/component.jsx
@@ -26,7 +26,11 @@ export default function Component({ service }) {
return (
-
+
diff --git a/src/widgets/qbittorrent/component.jsx b/src/widgets/qbittorrent/component.jsx
index 73dfacb5..0f0fa3af 100644
--- a/src/widgets/qbittorrent/component.jsx
+++ b/src/widgets/qbittorrent/component.jsx
@@ -74,9 +74,17 @@ export default function Component({ service }) {
<>
-
+
-
+
{widget?.enableLeechProgress &&
leechTorrents.map((queueEntry) => (
diff --git a/src/widgets/rutorrent/component.jsx b/src/widgets/rutorrent/component.jsx
index 245a786c..8f744b52 100644
--- a/src/widgets/rutorrent/component.jsx
+++ b/src/widgets/rutorrent/component.jsx
@@ -34,8 +34,8 @@ export default function Component({ service }) {
return (
-
-
+
+
);
}
diff --git a/src/widgets/speedtest/component.jsx b/src/widgets/speedtest/component.jsx
index 7be00aa2..bc579b76 100644
--- a/src/widgets/speedtest/component.jsx
+++ b/src/widgets/speedtest/component.jsx
@@ -54,6 +54,7 @@ export default function Component({ service }) {
style: "unit",
unit: "millisecond",
})}
+ highlightValue={speedtestData.data.ping}
/>
);
diff --git a/src/widgets/strelaysrv/component.jsx b/src/widgets/strelaysrv/component.jsx
index 026e19b7..e79345c4 100644
--- a/src/widgets/strelaysrv/component.jsx
+++ b/src/widgets/strelaysrv/component.jsx
@@ -29,10 +29,15 @@ export default function Component({ service }) {
-
+
);
diff --git a/src/widgets/tdarr/component.jsx b/src/widgets/tdarr/component.jsx
index 824a56b3..9dbc7e4d 100644
--- a/src/widgets/tdarr/component.jsx
+++ b/src/widgets/tdarr/component.jsx
@@ -46,7 +46,7 @@ export default function Component({ service }) {
-
+
);
}
diff --git a/src/widgets/transmission/component.jsx b/src/widgets/transmission/component.jsx
index 474fe69f..06b54951 100644
--- a/src/widgets/transmission/component.jsx
+++ b/src/widgets/transmission/component.jsx
@@ -36,9 +36,9 @@ export default function Component({ service }) {
return (
-
+
-
+
);
}
diff --git a/src/widgets/unraid/component.jsx b/src/widgets/unraid/component.jsx
index f7b8dc5c..1d90f34b 100644
--- a/src/widgets/unraid/component.jsx
+++ b/src/widgets/unraid/component.jsx
@@ -58,35 +58,59 @@ export default function Component({ service }) {
return (
-
-
+
+
+
-
+
-
{...POOLS.flatMap((pool) =>
- POOL_FIELDS.map(({ param, label, valueKey, valueType }) => (
-
- )),
+ POOL_FIELDS.map(({ param, label, valueKey, valueType }) => {
+ const poolValue = data.caches?.[widget?.[pool]]?.[valueKey] || "-";
+
+ return (
+
+ );
+ }),
)}
);
diff --git a/src/widgets/uptimekuma/component.jsx b/src/widgets/uptimekuma/component.jsx
index e8a42e48..a660a417 100644
--- a/src/widgets/uptimekuma/component.jsx
+++ b/src/widgets/uptimekuma/component.jsx
@@ -50,7 +50,7 @@ export default function Component({ service }) {
-
+
{incidentTime && (