feat: live system dashboard with real-time API data
- status/route.ts: add command-center + agents-api fetches alongside existing health checks - page.tsx: replace landing page with live infrastructure dashboard - Platform metrics (agents, orgs, repos, CF workers, health score) - Service health grid with latency and status indicators - Agent roster cards with skills, tasks, uptime - Pi fleet status (octavia, lucidia, alice, cecilia nodes) - Auto-refreshes every 30s with live countdown - Brand colors: amber #F5A623, hot-pink #FF1D6C, violet #9C27B0, electric-blue #2979FF - Dark #000 background Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -15,17 +15,36 @@ async function check(name: string, url: string, timeout = 4000) {
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchJson(url: string, fallback: unknown = null, timeout = 5000) {
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
signal: AbortSignal.timeout(timeout),
|
||||
headers: { 'User-Agent': 'blackroad-status/1.0', Accept: 'application/json' },
|
||||
} as RequestInit);
|
||||
if (!res.ok) return fallback;
|
||||
return await res.json();
|
||||
} catch {
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
const checks = await Promise.allSettled([
|
||||
check('blackroad-status worker', 'https://blackroad-status.amundsonalexa.workers.dev/api/ping'),
|
||||
check('blackroad-auth worker', 'https://blackroad-auth.amundsonalexa.workers.dev/auth/status'),
|
||||
check('agents-status worker', 'https://agents-status.blackroad.io/'),
|
||||
check('blackroad.io', 'https://blackroad.io/'),
|
||||
check('web app (Vercel)', 'https://blackroad-os-web.vercel.app/'),
|
||||
check('aria64 agent node', 'http://192.168.4.38:8080/health', 2000),
|
||||
check('blackroad-pi LLM node', 'http://192.168.4.64:11434/', 2000),
|
||||
check('alice mesh node', 'http://192.168.4.49:8001/', 2000),
|
||||
check('cecilia identity node', 'http://192.168.4.89:80/', 2000),
|
||||
const [checks, commandCenter, agentsApi] = await Promise.all([
|
||||
Promise.allSettled([
|
||||
check('command-center', 'https://command-center.blackroad.workers.dev/health'),
|
||||
check('agents-api', 'https://agents-api.blackroad.workers.dev/health'),
|
||||
check('blackroad-status worker', 'https://blackroad-status.amundsonalexa.workers.dev/api/ping'),
|
||||
check('blackroad-auth worker', 'https://blackroad-auth.amundsonalexa.workers.dev/auth/status'),
|
||||
check('agents-status worker', 'https://agents-status.blackroad.io/'),
|
||||
check('blackroad.io', 'https://blackroad.io/'),
|
||||
check('web app (Vercel)', 'https://blackroad-os-web.vercel.app/'),
|
||||
check('aria64 agent node', 'http://192.168.4.38:8080/health', 2000),
|
||||
check('blackroad-pi LLM node', 'http://192.168.4.64:11434/', 2000),
|
||||
check('alice mesh node', 'http://192.168.4.49:8001/', 2000),
|
||||
check('cecilia identity node', 'http://192.168.4.89:80/', 2000),
|
||||
]),
|
||||
fetchJson('https://command-center.blackroad.workers.dev/status'),
|
||||
fetchJson('https://agents-api.blackroad.workers.dev/agents'),
|
||||
]);
|
||||
|
||||
const services = checks.map(r => r.status === 'fulfilled' ? r.value : { name: 'unknown', status: 'down', latencyMs: -1 });
|
||||
@@ -40,10 +59,14 @@ export async function GET() {
|
||||
score: Math.round((operational / services.length) * 100),
|
||||
services,
|
||||
summary: { operational, degraded, down, total: services.length },
|
||||
command_center: commandCenter,
|
||||
agents_api: agentsApi,
|
||||
platform: {
|
||||
workers: 499,
|
||||
tunnel_routes: 14,
|
||||
agent_capacity: 30000,
|
||||
orgs: 17,
|
||||
repos: 1825,
|
||||
git_branch: 'master',
|
||||
repo: 'BlackRoad-OS-Inc/blackroad',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user