Admin wears the Control Room: light workspace, dark rail and topbar, Instrument scheme

The /admin console now looks like the member screens instead of the dark-navy
site.css back office (Marty: "the admin should be the same color as the site").
Same recipe as /tools (2026-10-08): cr.css is the design system, site.css loads
inside @layer legacy so the cr tokens win, tools.css restyles the shared legacy
panes, and the new admin.css does the admin-only parts.

- admin.html: page wrapped in #page; the pane menu (nav.bo-menu, same
  data-pane buttons and ids) is a dark rail with the Collapse toggle and Site
  links; topbar carries the crumb, #boTitle, #chainLine readout, admin who
  pill and Log out; a status strip with the chain and a Central clock; the
  sign-in card centred on the light workspace. Inline <style> moved to
  admin.css; the two dark-only inline backgrounds switched to panel tokens.
  Cache tags: admin.css/admin.js ?v=20261012a.
- admin.css: rail buttons mirror cr .rail a (wide and icon-only, phone bottom
  bar scrolls with icon + label), tables with mono headers and hover rows,
  status pills and the house tag in the light scheme, drip steps, rates and
  kv forms, label-wrapped inputs, blue action buttons, phone grids.
- admin.js: rail collapse remembers cr.rail like the member shell, strip
  clock, strip chain line, error text uses var(--bad) instead of #ff8a8a.

Member rail and cr-shell.js are untouched; the admin sign-in flow is the
same /api/admin/auth endpoints as before. Verified locally with Playwright
at 1366x900 and 390x844 on every pane plus /links as a member.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-12 10:55:10 -05:00
parent 568a25f975
commit d1a25e72f2
3 changed files with 215 additions and 107 deletions
+10 -1
View File
@@ -59,6 +59,14 @@
document.addEventListener('click', e => { const g = e.target.closest('[data-goto]'); if (g) setPane(g.dataset.goto); });
window.addEventListener('hashchange', () => setPane(location.hash.slice(1)));
$('boBurger').addEventListener('click', () => $('adminArea').classList.toggle('side-open'));
// Control Room frame (2026-10-12): the rail collapse remembers the member shell's choice; the strip clock ticks Central
(function () {
const app = $('adminArea'), tog = $('crRailTog');
try { app.classList.toggle('wide', localStorage.getItem('cr.rail') !== 'narrow'); } catch (e) {}
if (tog) tog.addEventListener('click', () => { const wide = !app.classList.contains('wide'); app.classList.toggle('wide', wide); try { localStorage.setItem('cr.rail', wide ? 'wide' : 'narrow'); } catch (e) {} });
const clock = () => { const c = $('stClock'); if (!c) return; try { c.textContent = new Date().toLocaleTimeString('en-US', { timeZone: 'America/Chicago', hour: 'numeric', minute: '2-digit' }) + ' CT'; } catch (e) { c.textContent = ''; } };
clock(); setInterval(clock, 30000);
})();
async function render() {
let me = { admin: false };
@@ -70,6 +78,7 @@
try {
const c = await IAP.getConfig();
$('chainLine').textContent = c.chainName + (c.rehearsal ? ' · rehearsal' : '');
if ($('stripChain')) $('stripChain').textContent = c.chainName + (c.rehearsal ? ' (rehearsal)' : '');
} catch (e) {}
setPane(location.hash.slice(1) || 'overview');
}
@@ -538,7 +547,7 @@
const r = await api('/api/admin/promos', { code: $('pcCode').value, credits: $('pcCredits').value, partner: $('pcPartner').value, maxUses: $('pcMax').value, expires: $('pcExpires').value || null, active: true });
msg.textContent = 'Saved ' + r.code.code + ': ' + r.code.credits + ' credits.'; msg.style.color = 'var(--mint)';
$('pcCode').value = ''; $('pcCredits').value = ''; $('pcPartner').value = ''; loadPromos();
} catch (e) { msg.textContent = e.message; msg.style.color = '#ff8a8a'; }
} catch (e) { msg.textContent = e.message; msg.style.color = 'var(--bad)'; }
});
async function loadTraffic() {
loadPromos().catch(e => IAP.status(e.message, 'bad'));