- ${key}
- ${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;