- index.html: replace Image() probe with fetch(no-cors) + AbortController
timeout. fetch resolves for any network response (incl. 4xx/5xx) so
resolve -> 'up', reject/timeout -> 'down'. Fixes the bug where 401/404
services were marked green.
- services.json: add Homepage service under 'dev' (was missing; the
homepage is one of the public homelab services). Now 21 services.
- services.json: fix ethereum category icon (' Ξ' -> 'Ξ') leading space.
- .gitignore (new): ignore /.playwright-mcp/ and services-page.png.
- git rm --cached the three stray dev artifacts so they leave the repo.
This commit is contained in:
+8
-7
@@ -81,13 +81,14 @@
|
||||
done = true;
|
||||
setStatusDot(dot, state);
|
||||
}
|
||||
var img = new Image();
|
||||
img.onload = function () { settle("up"); };
|
||||
img.onerror = function () { settle("up"); };
|
||||
img.onloadstart = function () {};
|
||||
var timeout = setTimeout(function () { settle("down"); }, 6000);
|
||||
img.src = url + "?_probe=" + Date.now();
|
||||
window.addEventListener("beforeunload", function () { clearTimeout(timeout); });
|
||||
var controller = window.AbortController ? new AbortController() : null;
|
||||
var timeout = setTimeout(function () {
|
||||
if (controller) controller.abort();
|
||||
settle("down");
|
||||
}, 6000);
|
||||
fetch(url, { mode: "no-cors", cache: "no-store", redirect: "follow", signal: controller ? controller.signal : undefined })
|
||||
.then(function () { clearTimeout(timeout); settle("up"); })
|
||||
.catch(function () { clearTimeout(timeout); settle("down"); });
|
||||
}
|
||||
|
||||
fetch(src)
|
||||
|
||||
Reference in New Issue
Block a user