From ce8f020b7bebd3376558d224b211590087077943 Mon Sep 17 00:00:00 2001 From: Rob van Oostenrijk Date: Thu, 7 May 2026 10:58:48 +0400 Subject: [PATCH] Enhancement: Add node parameter to Technitium DNS Widget (#6638) --- docs/widgets/services/technitium.md | 5 +++++ src/utils/config/service-helpers.js | 1 + src/widgets/technitium/component.jsx | 1 + src/widgets/technitium/widget.js | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/widgets/services/technitium.md b/docs/widgets/services/technitium.md index 70f5e48f5..5ef8ead23 100644 --- a/docs/widgets/services/technitium.md +++ b/docs/widgets/services/technitium.md @@ -14,6 +14,7 @@ widget: type: technitium url: key: biglongapitoken + node: # optional, defaults to current node range: LastDay # optional, defaults to LastHour ``` @@ -21,6 +22,10 @@ widget: This can be generated via the Technitium DNS Dashboard, and should be generated from a special API specific user. +#### Node + +`node` value determines which Technitium cluster node the statistics are returned for. Specifying a value of `cluster` returns aggregrate stats for all nodes in the cluster. Specify a node domain name to return specific node stats, no value returns stats for the node against which the API is executed. + #### Range `range` value determines how far back of statistics to pull data for. The value comes directly from Technitium API documentation found [here](https://github.com/TechnitiumSoftware/DnsServer/blob/master/APIDOCS.md#dashboard-api-calls), defined as `"type"`. The value can be one of: `LastHour`, `LastDay`, `LastWeek`, `LastMonth`, `LastYear`. diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index f68916f74..6a87f8423 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -665,6 +665,7 @@ export function cleanServiceGroups(groups) { if (enableRecentEvents !== undefined) widget.enableRecentEvents = enableRecentEvents; } if (type === "technitium") { + if (node !== undefined) widget.node = node; if (range !== undefined) widget.range = range; } if (type === "lubelogger") { diff --git a/src/widgets/technitium/component.jsx b/src/widgets/technitium/component.jsx index fa221025b..07911c7c2 100644 --- a/src/widgets/technitium/component.jsx +++ b/src/widgets/technitium/component.jsx @@ -14,6 +14,7 @@ export default function Component({ service }) { const { widget } = service; const params = { + node: widget.node ?? "", type: widget.range ?? "LastHour", }; diff --git a/src/widgets/technitium/widget.js b/src/widgets/technitium/widget.js index fc4577bef..8755d8e6a 100644 --- a/src/widgets/technitium/widget.js +++ b/src/widgets/technitium/widget.js @@ -8,7 +8,7 @@ const widget = { stats: { endpoint: "dashboard/stats/get", validate: ["response", "status"], - params: ["type"], + params: ["node", "type"], map: (data) => asJson(data).response?.stats, }, },