1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/src/dashboard/routes/loop_qa.py

35 lines
978 B
Python
Raw Normal View History

"""Loop QA health endpoints — capability self-test status."""
import logging
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse, JSONResponse
from dashboard.templating import templates
logger = logging.getLogger(__name__)
router = APIRouter(tags=["health"])
@router.get("/health/loop-qa")
async def loop_qa_health():
"""Return HealthSnapshot as JSON."""
from timmy.loop_qa import loop_qa_orchestrator
snapshot = loop_qa_orchestrator.get_health_snapshot()
return JSONResponse(content=snapshot)
@router.get("/health/loop-qa/partial", response_class=HTMLResponse)
async def loop_qa_health_partial(request: Request):
"""Return HTMX partial for the dashboard health panel."""
from timmy.loop_qa import loop_qa_orchestrator
snapshot = loop_qa_orchestrator.get_health_snapshot()
return templates.TemplateResponse(
request,
"partials/loop_qa_health.html",
{"snapshot": snapshot},
)