fix: Cache-Control no-cache на /admin + видимая версия страницы
У пользователя браузер отдавал устаревший admin.html (старый loadUsers перезатирал dropdown файлов), список «мигал и пропадал». Теперь сервер форсирует revalidate + в углу sidebar видна версия — если пишет 2026-05-06b, у пользователя свежая страница. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -940,7 +940,10 @@ async def admin_download_file_endpoint(request: Request):
|
|||||||
@app.get("/admin", response_class=HTMLResponse)
|
@app.get("/admin", response_class=HTMLResponse)
|
||||||
async def admin_page():
|
async def admin_page():
|
||||||
# Auth check is done client-side (JS) + all /api/admin/* endpoints require admin
|
# Auth check is done client-side (JS) + all /api/admin/* endpoints require admin
|
||||||
return Path("static/admin.html").read_text(encoding="utf-8")
|
html = Path("static/admin.html").read_text(encoding="utf-8")
|
||||||
|
# Без no-cache браузер мог отдавать устаревший HTML, в котором loadUsers()
|
||||||
|
# перезаписывал dropdown файлов и стирал результат loadFileUsers/loadFiles
|
||||||
|
return HTMLResponse(html, headers={"Cache-Control": "no-cache, must-revalidate"})
|
||||||
|
|
||||||
|
|
||||||
# === Batch V3: Generate + Verify + Auto-Retry ===
|
# === Batch V3: Generate + Verify + Auto-Retry ===
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ a { color: var(--accent); text-decoration: none; }
|
|||||||
<a href="#audit" onclick="showPage('audit')">Журнал</a>
|
<a href="#audit" onclick="showPage('audit')">Журнал</a>
|
||||||
<a href="#files" onclick="showPage('files')">Файлы</a>
|
<a href="#files" onclick="showPage('files')">Файлы</a>
|
||||||
<a href="/" class="back">← Вернуться в чат</a>
|
<a href="/" class="back">← Вернуться в чат</a>
|
||||||
|
<div style="position:absolute;bottom:.5rem;left:1rem;font-size:.65rem;color:#999">v.2026-05-06b</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
|||||||
Reference in New Issue
Block a user