From 037ab0623ae04ba32324a3a76f39a6b589bc2544 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 22 Nov 2026 02:44:14 +1100 Subject: [PATCH] feat(ui): serve Home and Status from the binary's health, approvals and runs (#2023) --- ui/src/dashboard/DashboardPage.vue | 36 ++--- ui/src/dashboard/HealthCard.vue | 60 ++++++++ ui/src/dashboard/NeedsAttentionCard.vue | 111 ++++++++------- ui/src/dashboard/RecentRunsCard.vue | 80 +++++++++++ ui/src/lib/api.ts | 48 ++++++- ui/src/lib/system-health.ts | 13 ++ ui/src/router/routes.ts | 4 +- ui/src/settings/HealthTables.vue | 176 +++++++----------------- ui/src/settings/InstanceCard.vue | 44 ++++++ ui/src/settings/SystemStatusPage.vue | 51 +++---- 10 files changed, 394 insertions(+), 229 deletions(-) create mode 100644 ui/src/dashboard/HealthCard.vue create mode 100644 ui/src/dashboard/RecentRunsCard.vue create mode 100644 ui/src/lib/system-health.ts create mode 100644 ui/src/settings/InstanceCard.vue diff --git a/ui/src/dashboard/DashboardPage.vue b/ui/src/dashboard/DashboardPage.vue index e5f55342b..415762e7b 100644 --- a/ui/src/dashboard/DashboardPage.vue +++ b/ui/src/dashboard/DashboardPage.vue @@ -1,35 +1,19 @@ diff --git a/ui/src/dashboard/HealthCard.vue b/ui/src/dashboard/HealthCard.vue new file mode 100644 index 000000000..aee277eed --- /dev/null +++ b/ui/src/dashboard/HealthCard.vue @@ -0,0 +1,60 @@ + + + diff --git a/ui/src/dashboard/NeedsAttentionCard.vue b/ui/src/dashboard/NeedsAttentionCard.vue index 6eb8383ba..e07ab1bc0 100644 --- a/ui/src/dashboard/NeedsAttentionCard.vue +++ b/ui/src/dashboard/NeedsAttentionCard.vue @@ -1,64 +1,83 @@ diff --git a/ui/src/dashboard/RecentRunsCard.vue b/ui/src/dashboard/RecentRunsCard.vue new file mode 100644 index 000000000..74b8118fc --- /dev/null +++ b/ui/src/dashboard/RecentRunsCard.vue @@ -0,0 +1,80 @@ + + + diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts index 0cf933134..f11d23ef9 100644 --- a/ui/src/lib/api.ts +++ b/ui/src/lib/api.ts @@ -279,7 +279,8 @@ export const api = { publishProposal: (id: string) => request(`/api/memory/proposals/${encodeURIComponent(id)}/publish`, { method: "POST", body: {} }), health: () => request("/health/detailed"), - services: () => request("/api/services"), + systemHealth: () => request("/api/system/health"), + bootstrap: () => request("/api/system/bootstrap"), policies: () => request("/api/access/policies"), denials: (limit?: number) => request(`/api/access/denials${limit ? `?limit=${limit}` : ""}`), @@ -715,6 +716,51 @@ export interface ApprovalAssertion { credential: unknown; } +/** One module's or dependency's readiness. */ +export interface HealthCheck { + name: string; + healthy: boolean; + error?: string; +} + +/** One accepted package: a connector, secret engine, guard or MCP server. */ +export interface ConnectorHealth { + name: string; + contract: string; + healthy: boolean; + error?: string; + failed_at?: string; +} + +export interface RunCounts { + queued: number; + running: number; + waiting: number; + waiting_approval: number; + parked: number; +} + +/** What the binary reports about itself: GET /api/system/health. */ +export interface SystemHealth { + version: string; + healthy: boolean; + checked_at: string; + checks: HealthCheck[]; + connectors: ConnectorHealth[]; + runner: { healthy: boolean; workers: number; error?: string; error_at?: string }; + waiting?: { approvals: number; runs: RunCounts }; + last_failure?: { source: string; cause: string; at: string; run_id?: string }; +} + +/** The values only the config file sets: GET /api/system/bootstrap. */ +export interface Bootstrap { + listen: string; + database_host: string; + schemas: number; + admin_token_set: boolean; + sealing_identity_set: boolean; +} + export interface ApprovalConfirmation { token: string; options: { publicKey: Record }; diff --git a/ui/src/lib/system-health.ts b/ui/src/lib/system-health.ts new file mode 100644 index 000000000..e907c91ff --- /dev/null +++ b/ui/src/lib/system-health.ts @@ -0,0 +1,13 @@ +import { onMounted } from "vue"; + +import { api } from "@/lib/api"; +import { usePoll, useRead } from "@/lib/use-read"; + +/** The binary's health, read on mount and every 15 seconds. The Home page and + * the Status page share it. */ +export function useSystemHealth() { + const read = useRead(() => api.systemHealth()); + onMounted(read.reload); + usePoll(read.reload, 15_000); + return read; +} diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 337fd04b4..8ee328167 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -53,7 +53,7 @@ export const routes: RouteRecordRaw[] = [ meta: { label: "Dashboard", description: - "Running work, work needing attention, token spend.", + "Health, what waits on a person, and recent runs.", section: "home", }, }, @@ -192,7 +192,7 @@ export const routes: RouteRecordRaw[] = [ settings: true, label: "Status", description: - "Service presence, dependency health, and build versions.", + "Module, connector and runner health, and the running version.", section: "system_status", }, }, diff --git a/ui/src/settings/HealthTables.vue b/ui/src/settings/HealthTables.vue index 260756472..b5e1798f2 100644 --- a/ui/src/settings/HealthTables.vue +++ b/ui/src/settings/HealthTables.vue @@ -1,143 +1,69 @@