"""Pry — Dashboard router (remaining api.py routes). Auto-extracted from api.py during the router-split refactor. """ # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC from __future__ import annotations import logging from datetime import UTC, datetime from fastapi import APIRouter from fastapi.responses import HTMLResponse from deps import automator, cache, ratelimiter logger = logging.getLogger(__name__) router = APIRouter(tags=["Dashboard"]) @router.get("/dashboard", tags=["Dashboard"], summary="Pry health and performance dashboard") async def dashboard() -> HTMLResponse: cache_stats = cache.stats() rate_stats = ratelimiter.get_stats() html = f"""
Scrape engine health and performance metrics
| Endpoint | Method | Status |
|---|---|---|
| /v1/scrape | POST | ✅ Active |
| /v1/crawl | POST | ✅ Active |
| /v1/automate | POST | ✅ Active |
| /v1/batch | POST | ✅ Active |
| /v1/stream | WebSocket | ✅ Active |
| /v1/run | POST | ✅ Active |
| FlareSolverr | Proxy | ✅ Connected |
Pry v3.0.0 — Generated {datetime.now(UTC).strftime("%Y-%m-%d %H:%M UTC")}
""" return HTMLResponse(content=html)