mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-29 07:21:16 -07:00
Enhancement: Add node parameter to Technitium DNS Widget (#6638)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
This commit is contained in:
@@ -14,6 +14,7 @@ widget:
|
|||||||
type: technitium
|
type: technitium
|
||||||
url: <url to dns server>
|
url: <url to dns server>
|
||||||
key: biglongapitoken
|
key: biglongapitoken
|
||||||
|
node: <node dns name or cluster> # optional, defaults to current node
|
||||||
range: LastDay # optional, defaults to LastHour
|
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.
|
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
|
||||||
|
|
||||||
`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`.
|
`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`.
|
||||||
|
|||||||
@@ -665,6 +665,7 @@ export function cleanServiceGroups(groups) {
|
|||||||
if (enableRecentEvents !== undefined) widget.enableRecentEvents = enableRecentEvents;
|
if (enableRecentEvents !== undefined) widget.enableRecentEvents = enableRecentEvents;
|
||||||
}
|
}
|
||||||
if (type === "technitium") {
|
if (type === "technitium") {
|
||||||
|
if (node !== undefined) widget.node = node;
|
||||||
if (range !== undefined) widget.range = range;
|
if (range !== undefined) widget.range = range;
|
||||||
}
|
}
|
||||||
if (type === "lubelogger") {
|
if (type === "lubelogger") {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default function Component({ service }) {
|
|||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
|
node: widget.node ?? "",
|
||||||
type: widget.range ?? "LastHour",
|
type: widget.range ?? "LastHour",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const widget = {
|
|||||||
stats: {
|
stats: {
|
||||||
endpoint: "dashboard/stats/get",
|
endpoint: "dashboard/stats/get",
|
||||||
validate: ["response", "status"],
|
validate: ["response", "status"],
|
||||||
params: ["type"],
|
params: ["node", "type"],
|
||||||
map: (data) => asJson(data).response?.stats,
|
map: (data) => asJson(data).response?.stats,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user