From 627e2c64d154c3f250f7a2fbb1586a2b57bca1de Mon Sep 17 00:00:00 2001 From: ai-bot Date: Thu, 1 Oct 2026 22:16:18 +0000 Subject: [PATCH] Update file --- static/app.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/static/app.js b/static/app.js index 62374a9..215937d 100644 --- a/static/app.js +++ b/static/app.js @@ -2,6 +2,8 @@ const keyList = document.querySelector("#key-list"); const keyCount = document.querySelector("#key-count"); +const lastCheckTitle = document.querySelector("#last-check-title"); +const nextCheckTitle = document.querySelector("#next-check-title"); function createKeyCard(key) { const card = document.createElement("article"); @@ -49,4 +51,23 @@ async function loadKeys() { } } +async function loadSummary() { + try { + const response = await fetch("/api/health-checks", { headers: { Accept: "application/json" } }); + if (!response.ok) { + throw new Error("Saved checks are unavailable."); + } + + const checks = await response.json(); + if (checks.length) { + lastCheckTitle.textContent = checks[0].checked_at; + nextCheckTitle.textContent = checks[0].next_check_due; + } + } catch { + lastCheckTitle.textContent = "Unavailable"; + nextCheckTitle.textContent = "Unavailable"; + } +} + loadKeys(); +loadSummary();