feat: show tag counts alongside doc counts on dashboard
All checks were successful
Deploy / deploy (push) Successful in 21s

Fetch /api/tags/ in parallel with /api/documents/ for each instance.
Dashboard now displays "X docs, Y tags" per master/replica.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 21:18:24 +01:00
parent 874f1dce0d
commit 12e0e7d202
2 changed files with 13 additions and 6 deletions

View File

@@ -89,13 +89,13 @@ def get_status(session: Session = Depends(get_session)):
}
async def _fetch_count(url: str, token: str) -> int | None:
async def _fetch_count(url: str, token: str, path: str = "/api/documents/") -> int | None:
import httpx
try:
async with httpx.AsyncClient(
headers={"Authorization": f"Token {token}"}, timeout=8.0
) as client:
r = await client.get(url.rstrip("/") + "/api/documents/", params={"page_size": 1})
r = await client.get(url.rstrip("/") + path, params={"page_size": 1})
r.raise_for_status()
return r.json().get("count")
except Exception: