From 559c95b74447256d770e6750caa8688808e71250 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Tue, 13 Oct 2026 07:43:33 +0000 Subject: [PATCH] Section 31 point 7: fill the multisig card from /api/setup --- static/app.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/static/app.js b/static/app.js index 2acb88b..bdaab06 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 setupTitle = document.querySelector("#setup-title"); +const setupDescription = document.querySelector("#setup-description"); const nextCheckTitle = document.querySelector("#next-check-title"); const nextCheckDetail = document.querySelector("#next-check-detail"); const overdueTitle = document.querySelector("#overdue-title"); @@ -168,6 +170,16 @@ function createKeyAlertNote(entry, open) { return note; } +function renderSetupShape(setup) { + // The setup card reads the threshold and the key count from the API, because + // the single setup may be any shape, not only 2-of-3 (section 31 point 7). + if (!setup || typeof setup.threshold !== "number" || typeof setup.key_count !== "number") { + return; + } + setupTitle.textContent = `${setup.threshold}-of-${setup.key_count}`; + setupDescription.textContent = `${setup.threshold} of ${setup.key_count} keys are required to sign. This app records check results only — never keys or seed phrases.`; +} + function renderSummary(status) { const scheduled = status.filter((entry) => entry.next_check_due); if (!scheduled.length) { @@ -432,10 +444,11 @@ function renderAlerts() { } async function loadDashboard() { - const [statusResult, alertResult, settingsResult] = await Promise.allSettled([ + const [statusResult, alertResult, settingsResult, setupResult] = await Promise.allSettled([ fetchJson("/api/key-status"), fetchJson("/api/alerts"), fetchJson("/api/settings"), + fetchJson("/api/setup"), ]); if (settingsResult.status === "fulfilled") { @@ -451,6 +464,9 @@ async function loadDashboard() { keyStatus = statusResult.value; keysLoaded = true; } + if (setupResult.status === "fulfilled") { + renderSetupShape(setupResult.value); + } renderKeyCards(); renderAlerts();