- DELETE /api/admin/users/{handle}/activities — deletes all activities/*.json, wipes _merged/ and

index.json, then triggers a rebuild. Admin-only.
  - /admin/ page — lists all users, each with a "Delete activities" button. Clicking asks for
  confirmation in a <dialog> before firing the request. Button shows "Deleted (N)" or an error inline.
  - "Admin" nav link — appears in the top-right for admins only, hidden for everyone else.
This commit is contained in:
Davide Scaini
2026-04-12 17:46:28 +02:00
parent 2774f436d8
commit d659b90cd9
3 changed files with 134 additions and 1 deletions
+10 -1
View File
@@ -200,6 +200,13 @@ try {
title=""
class="text-xs px-2 py-0.5 rounded-full bg-amber-900/60 text-amber-300 border border-amber-700/50 animate-pulse cursor-default"
></span>
<!-- Admin link — hidden until confirmed admin -->
<a
id="nav-admin"
href={`${baseUrl}admin/`}
style="display:none"
class="text-xs text-zinc-500 hover:text-white transition-colors px-1"
>Admin</a>
<!-- Logout button — hidden until logged in -->
<button
@@ -484,8 +491,10 @@ try {
const chk = document.getElementById('upload-keep-original');
if (chk && user.store_originals_default) chk.checked = true;
// Admin: poll for active jobs and show a badge in the nav
// Admin: show admin link and poll for active jobs
if (user.is_admin) {
const adminLink = document.getElementById('nav-admin');
if (adminLink) adminLink.style.display = '';
const badge = document.getElementById('admin-jobs-badge');
async function pollJobs() {
try {