Spaces:
Sleeping
Sleeping
Download frontend/src/pages/SystemStatus.jsx from vish07anth/ATA: direct link, hf CLI and curl.
- Browser
- Download file 2.98 kB
-
https://huggingface.co/spaces/vish07anth/ATA/resolve/main/frontend/src/pages/SystemStatus.jsx
- Command line
-
hf download hf://spaces/vish07anth/ATA/frontend/src/pages/SystemStatus.jsx
-
curl -L -o SystemStatus.jsx https://huggingface.co/spaces/vish07anth/ATA/resolve/main/frontend/src/pages/SystemStatus.jsx
2.98 kB
| // pages/SystemStatus.jsx | |
| import { useLiveData } from '../context/LiveDataContext' | |
| import { Card, StatusBadge, MetricCard } from '../components/ui' | |
| import { Activity, Brain, Car, Radio } from 'lucide-react' | |
| export default function SystemStatus() { | |
| const { status, junctions, wsStatus } = useLiveData() | |
| return ( | |
| <div className="space-y-6"> | |
| <div> | |
| <h2 className="text-lg font-bold text-white">System Status</h2> | |
| <p className="text-sm text-slate-400">Runtime health and configuration overview</p> | |
| </div> | |
| <div className="grid grid-cols-2 lg:grid-cols-4 gap-4"> | |
| <MetricCard label="SUMO Status" value={status?.system_status ?? 'β'} icon={Activity} | |
| accent={status?.system_status === 'running' ? 'green' : 'blue'} /> | |
| <MetricCard label="Sim Time" value={status?.simulation_time != null ? `${Number(status.simulation_time).toFixed(1)}s` : 'β'} icon={Activity} accent="blue" /> | |
| <MetricCard label="Junctions" value={junctions?.length ?? 0} icon={Radio} accent="blue" /> | |
| <MetricCard label="Vehicles" value={status?.vehicle_count ?? 0} icon={Car} accent="blue" /> | |
| </div> | |
| <Card title="System Information"> | |
| <div className="space-y-3 text-sm"> | |
| <Row label="System Status" value={<StatusBadge status={status?.system_status ?? 'stopped'} />} /> | |
| <Row label="Simulation Mode" value={status?.simulation_mode ?? 'β'} /> | |
| <Row label="GNN Prediction" value={<StatusBadge status={status?.prediction_available ? 'ACTIVE' : 'INACTIVE'} />} /> | |
| <Row label="WebSocket" value={<StatusBadge status={wsStatus.toUpperCase()} />} /> | |
| <Row label="Started At" value={status?.started_at ? new Date(status.started_at).toLocaleString() : 'β'} /> | |
| <Row label="Last Updated" value={status?.updated_at ? new Date(status.updated_at).toLocaleTimeString() : 'β'} /> | |
| <Row label="Emergency Count" value={status?.emergency_count ?? 0} /> | |
| <Row label="Current AI Method" value={status?.current_ai_method ?? 'β'} /> | |
| </div> | |
| </Card> | |
| <Card title="Architecture"> | |
| <pre className="text-xs text-slate-400 whitespace-pre-wrap leading-relaxed"> | |
| {`SUMO / TraCI | |
| β dynamic signalized-junction discovery | |
| β topology, movements, phase-derived conflict graph | |
| β valid green phases | |
| β SUMO traffic state and 10Γ36 history | |
| β GNN prediction | |
| β movement and phase demand | |
| β near-miss safety risk | |
| β DecisionEngine | |
| β emergency priority when present | |
| β SafetyGate | |
| β AI / rule / density / fixed-time / safe-stop fallback | |
| β yellow transition and TraCI phase execution`} | |
| </pre> | |
| </Card> | |
| </div> | |
| ) | |
| } | |
| function Row({ label, value }) { | |
| return ( | |
| <div className="flex items-center justify-between py-1.5 border-b border-slate-700/30 last:border-0"> | |
| <span className="text-slate-400">{label}</span> | |
| <span className="text-slate-200">{value}</span> | |
| </div> | |
| ) | |
| } | |