Add cool stuff

This commit is contained in:
KenwoodFox
2026-06-17 23:17:48 -04:00
parent 8df14aa846
commit 8266d27038
3 changed files with 12 additions and 30 deletions

View File

@@ -106,13 +106,13 @@
statListeners.textContent = formatListeners(listeners);
}
if (statStatus) {
statStatus.textContent = formatStatus(data.status);
var statusText = formatStatus(data.status);
statStatus.textContent = statusText;
statStatus.classList.remove("stat-value--ok", "stat-value--bad");
var status = String(data.status || "").toLowerCase();
if (status === "online" || status === "ok" || status === "up") {
statStatus.classList.add("stat-value--ok");
} else if (status === "offline" || status === "down" || status === "error") {
if (statusText !== "---" && String(data.status).toLowerCase() !== "online") {
statStatus.classList.add("stat-value--bad");
} else if (statusText !== "---") {
statStatus.classList.add("stat-value--ok");
}
}
}