Add an admin password field and session-backed auth handling for admin endpoints. admelist.html: introduce an admin password input and status text in the admin overview panel. app.js: store the password in sessionStorage (key: fedl_admin_password), populate the input on load, and persist changes; provide authHeaders() to inject a Basic Authorization header (fedl:password) into fetch requests; handle 401 responses by clearing the saved password and showing contextual error messages; wire password usage into save/update/delete run APIs. styles.css: add styling for the admin access panel and password field and adjust responsive rules. This enables browser-session admin authentication and clearer failure handling when admin credentials are missing or incorrect.
102 lines
3.3 KiB
HTML
102 lines
3.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
<title>Edit List - GD fedl</title>
|
|
<link rel="stylesheet" href="styles.css">
|
|
</head>
|
|
<body data-page="admelist">
|
|
<header>
|
|
<h1>FEDL Admin</h1>
|
|
<nav>
|
|
<a href="index.html">Home</a>
|
|
<a href="lists.html">Lists</a>
|
|
<a href="run.html">Submit Run</a>
|
|
<a href="players.html">Players</a>
|
|
<a href="rules.html">Rules</a>
|
|
<a href="roulette.html">Roulette</a>
|
|
</nav>
|
|
</header>
|
|
<main class="admin-shell">
|
|
<section class="panel admin-overview-panel">
|
|
<div>
|
|
<p class="hero-kicker">Control Center</p>
|
|
<h2>Manage the live list and incoming runs</h2>
|
|
<p class="muted">Use the first panel to edit placements and the second panel to review new run submissions.</p>
|
|
</div>
|
|
<div class="admin-access-panel">
|
|
<div class="admin-overview-badges">
|
|
<span>Live list editor</span>
|
|
<span>Run moderation</span>
|
|
</div>
|
|
<label class="admin-password-field" for="admin-password">
|
|
<span>Admin password</span>
|
|
<input id="admin-password" type="password" placeholder="Enter server password" autocomplete="current-password" />
|
|
</label>
|
|
<p id="admin-auth-status" class="muted">Saved only in this browser session.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="panel admin-panel">
|
|
<div class="admin-toolbar">
|
|
<div>
|
|
<p class="hero-kicker">List Editor</p>
|
|
<h2>Manage the live list</h2>
|
|
<p id="admin-status" class="muted">Loading list data...</p>
|
|
</div>
|
|
<div class="admin-actions">
|
|
<input id="admin-search" type="text" placeholder="Search rows..." />
|
|
<button id="add-row" type="button" class="btn ghost-btn">Add Row</button>
|
|
<button id="save-list" type="button" class="btn">Save List</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-wrap">
|
|
<table class="levels-table admin-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:90px">#</th>
|
|
<th style="width:140px">Level</th>
|
|
<th>Title</th>
|
|
<th>Video URL</th>
|
|
<th style="width:120px">Delete</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="admin-list-body"></tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="panel admin-panel">
|
|
<div class="admin-toolbar">
|
|
<div>
|
|
<p class="hero-kicker">Run Queue</p>
|
|
<h2>Review submitted runs</h2>
|
|
<p id="runs-admin-status" class="muted">Loading run submissions...</p>
|
|
</div>
|
|
<div class="admin-actions">
|
|
<input id="run-search" type="text" placeholder="Search submissions..." />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-wrap">
|
|
<table class="levels-table admin-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:130px">Status</th>
|
|
<th style="width:160px">Player</th>
|
|
<th>Level</th>
|
|
<th style="width:180px">Submitted</th>
|
|
<th style="width:240px">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="run-admin-body"></tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html>
|