[Feature Request] Improved visibility on service issues by highlighting fields. #4619
Replies: 2 comments 6 replies
-
I think this is a great feature request, and should be implemented. This has been asked before, but ignored due to lack of interest I think. Currently you can achieve this with some custom css and js, but it would be great if all you needed to do was add - TrueNAS:
icon: truenas-scale.png
href: http://your.server.ip
siteMonitor: http://your.server.ip
statusStyle: dot
widget:
type: truenas
fields: ["uptime", "alerts"]
highlightFields: "alerts" <----
url: http://your.server.ip
key: apikey
enablePools: true
nasType: scale Then there could be a line in |
Beta Was this translation helpful? Give feedback.
-
Here is some js hackery I did to get something working where I could define thresholds. Not well tested :) function WatchItem(service, container, threshold) {
this.service = service;
this.container = container;
this.threshold = threshold;
}
var watchItems = [
new WatchItem('Portainer', 1, ">0"),
new WatchItem('Uptime Kuma', 1, ">0"),
new WatchItem('Healthchecks.io', 1, ">0"),
new WatchItem('Uptime Robot', 1, ">0"),
new WatchItem('Crowdsec', 1, ">0"),
new WatchItem('Omada', 2, ">0"),
new WatchItem('NetAlertX', 3, ">0"),
new WatchItem('Truenas', 2, ">0"),
new WatchItem('Scrutiny', 1, ">0"),
new WatchItem('Scrutiny', 2, ">0"),
];
async function observeItem(item) {
await waitForItem(item);
item.element = document.querySelector(`[data-name='${item.service}']`).querySelector(".service-container").children[item.container];
const observer = new MutationObserver(function (item, mutations) {
mutations.forEach(function (mutation) {
if (eval(`${mutation.target.data}${item.threshold}`)) {
item.element.classList.add("fail-bg");
} else {
item.element.classList.remove("fail-bg");
}
});
}.bind(null, item));
observer.observe(item.element, { subtree: true, characterData: true });
}
function waitForItem(item) {
return new Promise(resolve => {
const observer = new MutationObserver(mutations => {
if (document.querySelector(`[data-name='${item.service}']`).querySelector(".service-container")) {
observer.disconnect();
resolve();
}
});
observer.observe(document.body, { childList: true, subtree: true });
});
}
watchItems.forEach(item => {
observeItem(item);
}); |
Beta Was this translation helpful? Give feedback.
-
Description
For a number of widgets, they are reporting some form of status that I would like to be able to easily see if its in a failure state. A good example would be the health checks widget, that shows the
down
field where I care if its not 0.Would like to see widgets or users being able to define rules or thresholds that could classify as issue with the field value.
This could be highlighted in 2 ways:
Instead of:

Something like this:

Other
No response
Beta Was this translation helpful? Give feedback.
All reactions