- Move all inline <script> blocks (layout head/theme, topbar dark toggle, foot, paste, new, history, mine, settings, admin, unlock) to external files under internal/web/static/. Page data reaches scripts via data-* attributes (data-paste-id, data-default-dark) instead of template vars. - Replace inline onclick handlers (copy, delete, stats toggle) with addEventListener wiring. - Convert inline style="" attributes to CSS utility classes; swatch colors are now set via CSSOM/DOM APIs instead of innerHTML strings. - script-src/style-src are now plain 'self'; img-src data: stays for the SVG data-URI backgrounds. Verified with headless chromium: zero CSP violations on all pages in dark and light presets, theme swatches, admin lock, tables and paste view render correctly.
35 lines
1.5 KiB
HTML
35 lines
1.5 KiB
HTML
{{template "head" .}}
|
|
{{template "topbar" .}}
|
|
<div class="center">
|
|
<div class="float unlock-card">
|
|
<div class="inner">
|
|
<h1>Admin</h1>
|
|
<form id="admin-key-form">
|
|
<div class="pw-field">
|
|
<input type="password" id="admin-key" placeholder="Admin key" autocomplete="off" autofocus>
|
|
</div>
|
|
<button class="btn" type="submit">Unlock</button>
|
|
<span id="admin-key-status"></span>
|
|
</form>
|
|
|
|
<div id="admin-panel" class="hidden">
|
|
<h2>Settings</h2>
|
|
<form id="admin-settings-form">
|
|
<table>
|
|
<tr><td>Rate-limit burst</td><td><input type="number" id="rl-burst" min="1" step="1"></td></tr>
|
|
<tr><td>Rate-limit refill per minute</td><td><input type="number" id="rl-refill" min="0.1" step="0.1"></td></tr>
|
|
<tr><td>Max content bytes</td><td><input type="number" id="max-content" min="1" step="1"></td></tr>
|
|
<tr><td>Default expiry</td><td><input type="text" id="default-expiry" placeholder="e.g. 168h, 30m, 0 = never"></td></tr>
|
|
<tr><td>Custom URL reservation days</td><td><input type="number" id="slug-days" min="1" step="1"></td></tr>
|
|
<tr><td>Burn viewer window (minutes)</td><td><input type="number" id="burn-window" min="1" step="1"></td></tr>
|
|
</table>
|
|
<button type="submit">Save</button>
|
|
<span id="admin-save-status"></span>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/static/admin.js" defer></script>
|
|
{{template "foot" .}}
|