Image src used raw f.url without key, causing 422 on private
dashboard routes and onerror hiding all images silently.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix disk metric to show container usage instead of host diskβ
psutil disk_usage shows host's 1.7TB disk which is meaningless.
Now calculates actual /api directory size and compares against
HF Spaces 50GB container limit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix status metrics to read container cgroup limits instead of hostβ
psutil reports host machine stats (126GB RAM) inside Docker.
Now reads from cgroup v2 (/sys/fs/cgroup/memory.current/.max),
falls back to cgroup v1, then psutil as last resort.
This correctly shows the container's 16GB RAM allocation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New module: app/dashboard/
- router.py: APIRouter with 5 endpoints
GET /dashboard/ β HTML dashboard page
GET /dashboard/status/ β CPU / RAM / Disk metrics via psutil
GET /dashboard/logs/ β tail of app.log (last N lines)
GET /dashboard/database/β inference_results.csv as JSON
GET /dashboard/uploads/ β list of uploaded images
GET /dashboard/uploads/{filename} β serve image file
- index.html: single-page dashboard with auto-refresh every 5s
Status cards (CPU%, RAM, Disk), Logs viewer, Records table,
Uploaded images grid
app/main.py: register dashboard router
requirements.txt: add psutil
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>