pending invite link, the rest is finished

This commit is contained in:
mdares
2026-01-03 21:56:26 +00:00
parent a0ed517047
commit b6eed8b6db
4 changed files with 45 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ type CycleRow = {
ideal: number | null;
};
const OFFLINE_MS = 15000;
const OFFLINE_MS = 30000;
const EVENT_WINDOW_SEC = 1800;
const MAX_EVENT_MACHINES = 6;
const TOL = 0.10;
@@ -74,6 +74,12 @@ function isOffline(ts?: string) {
return Date.now() - new Date(ts).getTime() > OFFLINE_MS;
}
function normalizeStatus(status?: string) {
const s = (status ?? "").toUpperCase();
if (s === "ONLINE") return "RUN";
return s;
}
function fmtPct(v?: number | null) {
if (v === null || v === undefined || Number.isNaN(v)) return "--";
return `${v.toFixed(1)}%`;
@@ -273,7 +279,7 @@ export default function OverviewPage() {
const offline = isOffline(hb?.ts);
if (!offline) online += 1;
const status = (hb?.status ?? "").toUpperCase();
const status = normalizeStatus(hb?.status);
if (!offline) {
if (status === "RUN") running += 1;
else if (status === "IDLE") idle += 1;