feat(queue): add queue monitoring dashboard and pending banner on files page
- Add /api/queue/stats endpoint with Redis queue lengths, Celery worker inspection, and DB processing summaries - Add /api/queue/pending-count lightweight endpoint for the files page banner - Add /admin/queue admin-only view with auto-refreshing queue dashboard - Add queue pending banner on /files page showing queued/processing count - Add Queue Monitor link to admin dropdown in navigation (desktop + mobile) - Add comprehensive tests for all new endpoints and views Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
Queue monitoring view for the admin dashboard.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from fastapi import Depends, Request
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.views.base import APIRouter, get_db, require_login, templates
|
||||
from app.views.settings import require_admin_access
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/admin/queue")
|
||||
@require_login
|
||||
@require_admin_access
|
||||
async def queue_dashboard(request: Request, db: Session = Depends(get_db)):
|
||||
"""
|
||||
Queue monitoring dashboard — admin only.
|
||||
|
||||
Displays Celery/Redis queue statistics and database processing summaries
|
||||
so administrators can monitor the document processing pipeline.
|
||||
"""
|
||||
return templates.TemplateResponse(
|
||||
"queue_dashboard.html",
|
||||
{
|
||||
"request": request,
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user