The web dashboard is a read-only React single-page application served by the DRAForge server. It visualizes cluster DRA resources, device pools, claims, allocation status, and the live resource relationship graph.
The dashboard enforces a strict read-only public API model:
GET requests.kubeconfig.* (public), configurable via CORS_ALLOWED_ORIGINS.| Endpoint | Method | Description |
|---|---|---|
/api/summary |
GET | Cluster-wide counts (pools, devices, claims, doctor status) |
/api/pools |
GET | Simulated device pools |
/api/devices |
GET | Discovered devices |
/api/claims |
GET | ResourceClaims and their allocation status |
/api/graph |
GET | Snapshot of the resource relationship graph |
/api/doctor |
GET | Diagnostics check results (PASS/WARN/FAIL) |
/api/explain?claim=X&namespace=default |
GET | Allocation explanation tree for a claim |
/api/stream |
SSE | Live graph updates via Server-Sent Events |
The /api/stream endpoint pushes ResourceGraph JSON updates every 5 seconds.
The dashboard handles the stream with controlled reconnection:
connectedreconnecting with backoff: 1s → 2s → 5s (max)connectedA stream status badge is visible in the dashboard header.
When no DRA resources are discovered, the dashboard shows clear messages:
API errors are displayed inline without raw stack traces:
{ "error": { "message": "...", "code": "..." } } are parsed safely.{ "error": "..." } format is also supported.# Install dependencies
pnpm --dir web install
# Start dev server (port 3000, proxies /api to localhost:8080)
pnpm --dir web dev
# Build for production
pnpm --dir web build
# Lint
pnpm --dir web lint
The production build outputs to web/dist/, which is served by the Go server from ./web/dist/.
| Symptom | Likely Cause | Check |
|—|—|—|
| Dashboard shows “Disconnected” | Go server not running or /api/stream unreachable | Server logs, network |
| All data shows “No DRA resources” | No SimulatedDevicePool CRD applied | kubectl get simpool |
| Doctor tab shows no data | Server cannot connect to cluster | kubectl cluster-info |
| Graph empty | No resource relationships exist | Deploy a scenario |
```