'use client'; import { useEffect, useState } from 'react'; import { apiFetch } from '@/lib/api'; import { cn } from '@/lib/cn'; interface SystemHealth { probedAtMs: number; db: { ok: boolean; latencyMs: number | null }; redis: { ok: boolean; latencyMs: number | null; queueDepth: number | null }; docker: { containerCount: number | null }; } export default function AdminSystemPage() { const [health, setHealth] = useState(null); useEffect(() => { apiFetch('/v1/admin/system').then(setHealth); const t = setInterval(() => apiFetch('/v1/admin/system').then(setHealth), 5000); return () => clearInterval(t); }, []); return (

System health

Live probes — Postgres, Redis, BullMQ queue depth, Docker container count. Refreshes every 5 seconds.

{!health && (

Probing…

)} {health && (
)} {health && (

probed in {health.probedAtMs}ms

)}
); } function ServiceCard({ title, ok, primary, sub, }: { title: string; ok: boolean; primary: string; sub: string; }) { return (
{title}
{ok ? 'ok' : 'down'}
{primary}
{sub}
); }