Add cool stuff
This commit is contained in:
10
js/live.js
10
js/live.js
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user