Files
roast_command_center/public/admin.html
T
2026-08-09 14:30:42 -04:00

223 lines
7.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Admin — Roast Planner</title>
<link rel="stylesheet" href="/app.css?v=__ASSET_VERSION__" />
<link rel="icon" href="/icon.svg?v=__ASSET_VERSION__" type="image/svg+xml" />
<meta name="theme-color" content="#A8481A" />
</head>
<body>
<div class="app-shell">
<nav class="side-nav" id="side-nav" aria-label="Main navigation">
<div class="side-nav-brand">
<img class="brand-mark" src="/brand-mark.svg?v=__ASSET_VERSION__" alt="" aria-hidden="true" />
<span class="brand-name">Roast Planner</span>
</div>
<div id="nav-links"></div>
<div class="nav-spacer"></div>
<button
class="icon-btn nav-collapse-toggle"
type="button"
id="nav-collapse"
aria-label="Collapse navigation"
title="Collapse navigation"
>
«
</button>
<div class="nav-user">
<div class="nav-user-avatar" id="nav-user-avatar" aria-hidden="true"></div>
<div class="nav-user-detail">
<span class="nav-user-email" id="account-email"></span>
<button class="nav-user-logout" type="button" id="btn-logout">
Log out
</button>
</div>
</div>
</nav>
<div class="app-workspace" id="app-workspace">
<header class="app-header">
<div class="header-row-top">
<button
class="icon-btn nav-hamburger"
type="button"
id="nav-hamburger"
aria-label="Open navigation"
aria-expanded="false"
>
</button>
<div class="brand">
<div class="brand-text">
<h1>Administration</h1>
<p class="brand-sub">Users, plans, and app settings</p>
</div>
</div>
</div>
</header>
<div class="drawer-overlay hidden" id="drawer-overlay"></div>
<main class="page-content wide">
<section class="stat-grid" id="metrics" aria-label="Metrics"></section>
<section class="panel-card" id="reset-links-card" hidden>
<div class="panel-head"><h2>Pending password resets</h2></div>
<div class="panel-body">
<p class="muted">
No outgoing email is configured for this deployment
(<code>SMTP_URL</code>). Hand these links to the user
directly.
</p>
<div class="table-wrap">
<table class="data-table" id="resets-table">
<thead>
<tr>
<th>Email</th>
<th>Link</th>
<th>Expires</th>
</tr>
</thead>
<tbody id="resets-body"></tbody>
</table>
</div>
</div>
</section>
<section class="panel-card">
<div class="panel-head"><h2>Signups</h2></div>
<div class="panel-body">
<label
style="display:flex;align-items:center;gap:10px;font-size:13px;color:var(--ink-2)"
><span class="switch"
><input type="checkbox" id="signup-toggle" /><span
class="switch-track"
></span></span
>Allow new signups</label
>
</div>
</section>
<section class="panel-card" id="llm-card">
<div class="panel-head"><h2>LLM</h2></div>
<div class="panel-body">
<p class="muted" style="margin-top:0">
Model used for URL prefill and finished-roast reviews.
</p>
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap">
<select
class="text-input"
id="llm-model-select"
style="max-width:360px"
aria-label="LLM model"
></select>
<button class="ghost-btn small" type="button" id="llm-model-save">
Save
</button>
</div>
<p class="field-note" id="llm-model-note"></p>
</div>
</section>
<section class="panel-card" id="backup-card">
<div class="panel-head"><h2>Backup</h2></div>
<div class="panel-body">
<p class="muted">
Export downloads the <strong>entire database</strong> (all
users and their data) as one JSON file. Import
<strong>replaces everything</strong> with a previously
exported file.
</p>
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center">
<a class="ghost-btn" href="/api/admin/backup" download
>Export full backup</a
>
<label class="filebtn ghost-btn"
>Import backup…<input
type="file"
id="backup-import-file"
accept="application/json,.json"
/></label>
</div>
<p class="field-note" id="backup-note"></p>
</div>
</section>
<section class="panel-card" id="users">
<div class="panel-head">
<h2>Users</h2>
<input
class="text-input"
id="user-search"
placeholder="Search by email…"
style="max-width:220px"
/>
</div>
<div class="panel-body">
<div class="table-wrap">
<table class="data-table" id="users-table">
<thead>
<tr>
<th>Email</th>
<th>Role</th>
<th>Status</th>
<th class="num">Plans</th>
<th>Joined</th>
<th></th>
</tr>
</thead>
<tbody id="users-body"></tbody>
</table>
</div>
</div>
</section>
<section class="panel-card" id="plans">
<div class="panel-head">
<h2>Roast plans</h2>
<button class="ghost-btn small hidden" id="clear-plan-filter">
Clear filter
</button>
</div>
<div class="panel-body">
<div class="table-wrap">
<table class="data-table" id="plans-table">
<thead>
<tr>
<th>Owner</th>
<th>Title</th>
<th>Updated</th>
</tr>
</thead>
<tbody id="plans-body"></tbody>
</table>
</div>
</div>
</section>
<section class="panel-card" id="activity">
<div class="panel-head"><h2>Recent activity</h2></div>
<div class="panel-body">
<div class="table-wrap">
<table class="data-table" id="audit-table">
<thead>
<tr>
<th>When</th>
<th>Actor</th>
<th>Action</th>
<th>Target</th>
</tr>
</thead>
<tbody id="audit-body"></tbody>
</table>
</div>
</div>
</section>
</main>
</div>
</div>
<script type="module" src="/js/admin.js?v=__ASSET_VERSION__"></script>
</body>
</html>