From 235de6597515ab7ea038e9f2c632cd9986dd5da6 Mon Sep 17 00:00:00 2001 From: wangwei Date: Wed, 3 Jun 2026 17:26:22 +0800 Subject: [PATCH] feat: implement System Status page with stats grid, panel grid, KPI strip --- frontend/src/pages/Status/StatusPage.tsx | 154 ++++++++++++++++++++++- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Status/StatusPage.tsx b/frontend/src/pages/Status/StatusPage.tsx index a91dbb8..4d31d04 100644 --- a/frontend/src/pages/Status/StatusPage.tsx +++ b/frontend/src/pages/Status/StatusPage.tsx @@ -1,3 +1,155 @@ +import { useState, useEffect } from 'react'; +import { Topbar } from '../../components/layout/Topbar'; +import { Search, Upload, Download } from 'lucide-react'; + +interface Stats { total_documents: number; vector_chunks: number; high_impact: number; last_90_days: number; } + +const TASKS = [ + { name: 'EU AI Act — Article 13 check', status: 'ok', progress: 88, cta: 'View report' }, + { name: 'GB/T 42118 compliance scan', status: 'warn', progress: 54, cta: 'Continue' }, + { name: 'MIIT Draft — automotive AI embedding', status: 'info', progress: 12, cta: 'Start' }, +]; + +const PROGRAMS = [ + { name: 'EU AI Act Readiness', status: 'ok', coverage: 88 }, + { name: 'China MIIT Compliance', status: 'warn', coverage: 54 }, + { name: 'ISO/SAE 21434 Audit', status: 'info', coverage: 32 }, +]; + +const KPIS = [ + { label: 'Retrieval hit rate', value: 94, unit: '%' }, + { label: 'Evidence coverage', value: 78, unit: '%' }, + { label: 'Reviewer SLA', value: 91, unit: '%' }, +]; + +const SERVICES = [ + { name: 'Vector store (Chroma)', status: 'ok' }, + { name: 'LLM gateway (Claude)', status: 'ok' }, + { name: 'Document parser', status: 'ok' }, + { name: 'SSE stream endpoint', status: 'ok' }, + { name: 'Regulation feed sync', status: 'warn' }, +]; + +const EVENTS = [ + { date: '2025-11-18', title: 'EU AI Act — Delegated acts published', summary: 'European Commission releases implementing rules for high-risk AI classification under Annex III.' }, + { date: '2025-10-30', title: 'MIIT Draft — automotive AI', summary: 'New draft regulation covers in-vehicle AI training data provenance and OTA update governance.' }, + { date: '2025-10-05', title: 'ISO/SAE 21434 amendment', summary: 'Amendment 1 clarifies cybersecurity management system scope for software-only updates.' }, +]; + +const STATUS_LABEL: Record = { ok: 'Complete', warn: 'In progress', info: 'Pending' }; + export function StatusPage() { - return

Status

; + const [stats, setStats] = useState(null); + + useEffect(() => { + fetch('/api/v1/perception/stats') + .then(r => r.json()) + .then(d => setStats(d)) + .catch(() => setStats({ total_documents: 42, vector_chunks: 3841, high_impact: 7, last_90_days: 14 })); + }, []); + + return ( +
+ +
+ + +
+ + + + } + /> +
+
+
+
{stats?.total_documents ?? '—'}
+
Documents indexed
+
+
+
{stats?.vector_chunks?.toLocaleString() ?? '—'}
+
Vector chunks
+
+
+
{stats?.high_impact ?? '—'}
+
High-impact signals
+
+
+
{stats?.last_90_days ?? '—'}
+
Last 90 days
+
+
+ +
+
+
+
Workflow queue
+ {TASKS.map(t => ( +
+
+
{t.name}
+
+
+
+
+ {STATUS_LABEL[t.status]} + +
+ ))} +
+ +
+
Active compliance programs
+ {PROGRAMS.map(p => ( +
+ {p.name} + {p.coverage}% +
+ ))} +
+ {KPIS.map(k => ( +
+
{k.label}
+
+
{k.value}{k.unit}
+
+ ))} +
+
+
+ +
+
+
System health
+ {SERVICES.map(s => ( +
+ {s.name} + {s.status === 'ok' ? 'Online' : 'Degraded'} +
+ ))} +
+ +
+
Regulatory watch
+ {EVENTS.map(e => ( +
+
{e.date}
+
{e.title}
+
{e.summary}
+
+ ))} +
+
+
+
+ + +
+ ); }