/** * admin-relay-panel.ts — Serves the relay admin dashboard HTML at /admin/relay. * * This is a self-contained vanilla-JS SPA served as inline HTML from Express. * Auth gate: on first visit the user is prompted for ADMIN_TOKEN, which is * stored in localStorage and sent as Bearer on every API call. * * Tabs: * Queue — Pending events list with Approve / Reject; auto-refreshes every 15s * Accounts — Whitelist table with Revoke; pubkey grant form * * Stats bar at top: pending, approved today, total accounts. */ import { Router } from "express"; const router = Router(); router.get("/admin/relay", (_req, res) => { res.setHeader("Content-Type", "text/html"); res.send(ADMIN_PANEL_HTML); }); export default router; // ───────────────────────────────────────────────────────────────────────────── // HTML is defined as a const so the file stays a valid TS module with no imports // at runtime and no build step required. // ───────────────────────────────────────────────────────────────────────────── const ADMIN_PANEL_HTML = `
Enter the relay admin token to access the dashboard. It will be remembered in this browser.