0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-10 23:40:11 +00:00

Update the bundled dashboard to use api v2

This commit is contained in:
Pēteris Caune 2022-12-22 16:40:16 +02:00
parent afbce84731
commit 39baf36340
No known key found for this signature in database
GPG key ID: E28D7679E9A9EDE2

View file

@ -22,12 +22,6 @@
background: #263026; background: #263026;
} }
.theme-dark #panel > div.status-started {
color: #FFF;
background: #263026;
}
.theme-dark #panel > div.status-grace { .theme-dark #panel > div.status-grace {
color: #000; color: #000;
background: #FFB300; background: #FFB300;
@ -39,7 +33,7 @@
} }
.theme-dark .spinner:after { .theme-dark .spinner:after {
border-color: #4c604c transparent #4c604c transparent; border-color: rgba(255, 255, 255, 0.3) transparent rgba(255, 255, 255, 0.3) transparent;
} }
/* Colors, light theme */ /* Colors, light theme */
@ -68,7 +62,7 @@
} }
.theme-light .spinner:after { .theme-light .spinner:after {
border-color: #DDD transparent #DDD transparent; border-color: rgba(0, 0, 0, 0.2) transparent rgba(0, 0, 0, 0.2) transparent;
} }
@ -174,7 +168,7 @@
} }
} }
}; };
httpRequest.open("GET", "/api/v1/checks/"); httpRequest.open("GET", "/api/v2/checks/");
httpRequest.setRequestHeader("X-Api-Key", key); httpRequest.setRequestHeader("X-Api-Key", key);
httpRequest.send(); httpRequest.send();
} }
@ -215,7 +209,7 @@
var fragment = document.createDocumentFragment(); var fragment = document.createDocumentFragment();
sorted.forEach(function(item) { sorted.forEach(function(item) {
var div = template.cloneNode(true); var div = template.cloneNode(true);
div.setAttribute("class", tag + " status-" + item.status); div.setAttribute("class", tag + " status-" + item.status + (item.started ? " status-started" : ""));
div.querySelector(".name").textContent = item.name || "unnamed"; div.querySelector(".name").textContent = item.name || "unnamed";
if (item.last_ping) { if (item.last_ping) {
var s = timeSince(Date.parse(item.last_ping)) + " ago"; var s = timeSince(Date.parse(item.last_ping)) + " ago";