diff --git a/main.py b/main.py index a11fb35..32c9d32 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ from fastapi.responses import FileResponse, HTMLResponse, JSONResponse, Streamin from fastapi.staticfiles import StaticFiles from auth import authenticate, verify_token, make_download_ticket, verify_download_ticket -from db import clear_history, get_audit_log, get_history, get_history_any_user, init_db, list_sessions, log_action, ping as db_ping, save_feedback, save_message +from db import clear_history, get_audit_log, get_feedback, get_history, get_history_any_user, init_db, list_sessions, log_action, ping as db_ping, save_feedback, save_message from tus_upload import register_tus # Backend: "claude" (Docker sandbox), "glm" (GLM-5 + CAG), "auto" (route by task) @@ -883,6 +883,14 @@ async def admin_audit(request: Request): return get_audit_log(limit, offset, username, action) +@app.get("/api/admin/feedback") +async def admin_feedback(request: Request): + """Жалобы пользователей на ответы («сообщить об ошибке») — admin only.""" + _require_admin(request) + limit = int(request.query_params.get("limit", "200")) + return get_feedback(limit) + + @app.get("/api/admin/stats") async def admin_stats(request: Request): """Dashboard stats: messages per day, total sessions, etc.""" diff --git a/static/admin.html b/static/admin.html index 9197a98..c2b7dd4 100644 --- a/static/admin.html +++ b/static/admin.html @@ -66,6 +66,7 @@ document.addEventListener('DOMContentLoaded',applyThemeIcon); Приглашения Сессии Журнал + Жалобы Файлы 🌙 Тёмная тема ← Вернуться в чат @@ -125,6 +126,18 @@ document.addEventListener('DOMContentLoaded',applyThemeIcon); + +
| Время | Пользователь | Комментарий | Ответ (фрагмент) |
|---|