Moderation entfernt, JSON-API unter /api

- Moderationsseite und Melde-Funktion (report) komplett ausgebaut; folgt
  als eigenständiges Projekt
- alle API-Endpunkte unter /api, dort ausschließlich JSON: auch 404, 405,
  Rate-Limit (429) und Panics (500)
- Fehler nur über HTTP-Status; stille DB-Fehler in stats, logout und
  Vote-Zählern liefern jetzt 500 statt Nullen
- /auth/headerbar entfernt (Frontend nutzt /api/user/info)
- Frontend auf /api und statusbasierte Auswertung umgestellt
- notes/api.md neu als Referenz der aktuellen API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TiXsPUqw7oeomZ8wZrQW5q
This commit is contained in:
irrlicht
2026-09-26 23:10:02 +02:00
co-authored by Claude Opus 5.5
parent 2714fdb1a5
commit 030a5bd943
21 changed files with 430 additions and 726 deletions
+10 -2
View File
@@ -1,6 +1,6 @@
"use strict";
// Statistik-Seite: holt die Aggregate von /stats/detail und rendert Zahlen +
// Statistik-Seite: holt die Aggregate von /api/stats/detail und rendert Zahlen +
// einfache CSS-Balken (keine Chart-Library, CSP-konform). Balkenbreiten werden
// per CSSOM (el.style.width) gesetzt -> kein Inline-style-Attribut, daher von
// der strikten CSP nicht betroffen.
@@ -63,7 +63,15 @@ function renderBars(container, items, formatLabel) {
}
async function render() {
const s = await api.get("/stats/detail");
const res = await api.get("/stats/detail");
if (!res.ok) {
const p = document.createElement("p");
p.className = "msg";
p.textContent = errMsg(res.data, "Statistik konnte nicht geladen werden.");
document.getElementById("stat-overview").append(p);
return;
}
const s = res.data;
// --- Auf einen Blick ---
const overview = document.getElementById("stat-overview");