diff --git a/index.html b/index.html index 6c946f2..edaea3d 100644 --- a/index.html +++ b/index.html @@ -7,27 +7,37 @@ uppe.rs @@ -53,6 +77,7 @@

uppe.rs

keeping track of your infra's up status


+ now -->
@@ -66,7 +91,7 @@ function cell(timestamp, rtt) { warning = " warning"; } if (rtt === null) { - return ``; + return ``; } else { return `${rtt}`; } @@ -78,12 +103,11 @@ function card(key, history, last_rtt) { bar += cell(el[0], el[1]); } return `
-

${key} (${last_rtt}ms)

+

${key} ${last_rtt ? last_rtt + 'ms' : 'DOWN'}

- ${bar} + ${bar}
-
-
`; + `; } let main = document.getElementById("uppe-rs-content"); @@ -91,6 +115,11 @@ let main = document.getElementById("uppe-rs-content"); async function updateStatus() { let res = await fetch("/api/status") let status = await res.json() + if (status.error) { + console.error("server error:", status); + return; + } + let keys = Object.keys(status); keys.sort(); @@ -100,6 +129,7 @@ async function updateStatus() { let res = await fetch(`/api/status/${key}?limit=120`); let history = await res.json(); out += card(key, history, status[key]); + out += "\n"; } main.innerHTML = out;