feat: implement Stats endpoints for web dashboard
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user