feat: show tag counts alongside doc counts on dashboard
All checks were successful
Deploy / deploy (push) Successful in 21s
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user