Admin UX: light/dark theme, gallery pagination, content modal + delete, openai type

- Light/dark theme toggle persisted in localStorage
- Gallery pagination: page size 50/100/150/200 with prev/next
- Fullscreen modal viewer (image/video/audio) with metadata and delete
- Delete content: DELETE /api/generations/:id removes file (media-dir guarded)
  and journal record; added Journal.deleteById
- Provider types now include openai
- HTML output escaping in UI
This commit is contained in:
OpenCode
2026-08-17 18:13:36 +07:00
parent 6ff2b27556
commit 1bc3746594
5 changed files with 216 additions and 31 deletions
+5
View File
@@ -106,6 +106,11 @@ export class Journal {
return rows as GenerationRecord[];
}
deleteById(id: string): boolean {
const r = this.db.prepare('DELETE FROM generations WHERE id = ?').run(id);
return r.changes > 0;
}
stats(sinceDays?: number): UsageStats {
const filter = sinceDays
? `WHERE created_at >= datetime('now', '-${Math.max(1, Math.floor(sinceDays))} days')`