feat: implement Stats endpoints for web dashboard

This commit is contained in:
2026-04-07 14:58:09 -04:00
parent b46934db46
commit 697929a127
3 changed files with 40 additions and 1 deletions

View File

@@ -123,3 +123,14 @@ async def get_logs(
"offset": offset,
"data": logs
}
class StatsResponse(BaseModel):
total_logs: int
unique_attackers: int
active_deckies: int
@app.get("/api/v1/stats", response_model=StatsResponse)
async def get_stats(current_user: str = Depends(get_current_user)) -> dict[str, Any]:
return await repo.get_stats_summary()