ecfb2d3351
Tests · Go / test (push) Successful in 1m58s
Add the games, runtime, and engine-version pages over the existing lobby,
runtime, and engine-version services (no new business logic).
- GET/POST /_gm/games list + create public game
- GET /_gm/games/{id} detail incl. runtime snapshot
- POST /_gm/games/{id}/force-start|stop game state actions
- POST /_gm/games/{id}/ban-member ban a member (uuid + reason)
- POST /_gm/games/{id}/runtime/restart|patch|force-next-turn
- GET/POST /_gm/engine-versions registry + register
- POST /_gm/engine-versions/{ver}/disable disable a version
Console depends on GameAdmin / RuntimeAdmin / EngineVersionAdmin interfaces
(satisfied by the concrete services) so the pages render in tests without a
database. Collection-mutating POSTs are mounted on the collection path to avoid
a static-vs-param route conflict in gin. Writes flow through the CSRF guard and
redirect back; the create form parses datetime-local as UTC.
Tests: list/detail (with and without a runtime), create (visibility/owner/time
assertions), force-start (+ bad-CSRF), ban-member (+ bad uuid), runtime patch
(+ missing version), engine-version list/register/disable, and unavailable.
Docs: backend/docs/admin-console.md page inventory extended.
103 lines
3.8 KiB
CSS
103 lines
3.8 KiB
CSS
/* Admin console stylesheet. Deliberately small and dependency-free: the
|
|
console is an internal operator tool, not a public surface. */
|
|
:root {
|
|
--bg: #11151c;
|
|
--panel: #1b2230;
|
|
--panel-hi: #232c3d;
|
|
--ink: #e6ebf2;
|
|
--ink-dim: #9aa7ba;
|
|
--line: #2c3850;
|
|
--accent: #5aa9ff;
|
|
--danger: #ff6b6b;
|
|
--ok: #4ecb8d;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
}
|
|
a { color: var(--accent); text-decoration: none; }
|
|
a:hover { text-decoration: underline; }
|
|
.topbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1.5rem;
|
|
padding: 0.6rem 1.2rem;
|
|
background: var(--panel);
|
|
border-bottom: 1px solid var(--line);
|
|
}
|
|
.topbar .brand { font-weight: 700; letter-spacing: 0.04em; }
|
|
.topbar .mainnav { display: flex; gap: 1rem; flex: 1; }
|
|
.topbar .mainnav a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
|
|
.topbar .who { color: var(--ink-dim); }
|
|
.content { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
|
|
h1 { font-size: 1.4rem; margin: 0 0 0.4rem; }
|
|
.lede { color: var(--ink-dim); margin-top: 0; }
|
|
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
|
|
.card {
|
|
display: block;
|
|
padding: 1rem 1.2rem;
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: 8px;
|
|
color: var(--ink);
|
|
}
|
|
.card:hover { background: var(--panel-hi); text-decoration: none; }
|
|
.card h2 { font-size: 1.05rem; margin: 0 0 0.3rem; color: var(--accent); }
|
|
.card p { margin: 0; color: var(--ink-dim); font-size: 0.9rem; }
|
|
|
|
.panel {
|
|
padding: 0.9rem 1.1rem;
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: 8px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
.panel h2 { font-size: 1rem; margin: 0 0 0.6rem; color: var(--ink); }
|
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
|
|
.grid .panel { margin-bottom: 0; }
|
|
.kv { list-style: none; margin: 0; padding: 0; }
|
|
.kv li { padding: 0.15rem 0; color: var(--ink-dim); }
|
|
.counts { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
|
|
.counts td { padding: 0.2rem 0; border-bottom: 1px solid var(--line); color: var(--ink-dim); }
|
|
.counts td.num { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
|
|
.bignum { font-size: 1.6rem; margin: 0; color: var(--ink); }
|
|
.note { color: var(--ink-dim); font-style: italic; margin: 0.2rem 0; }
|
|
.errors { border-color: var(--danger); }
|
|
.errors ul { margin: 0; padding-left: 1.1rem; color: var(--danger); }
|
|
.ok { color: var(--ok); }
|
|
.bad { color: var(--danger); }
|
|
|
|
.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 1rem; }
|
|
.list th, .list td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line); }
|
|
.list th { color: var(--ink-dim); font-weight: 600; }
|
|
.list tr:hover td { background: var(--panel-hi); }
|
|
.pager { display: flex; gap: 1rem; align-items: center; color: var(--ink-dim); }
|
|
.form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-top: 0.8rem; }
|
|
.form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--ink-dim); }
|
|
.form input, .form select {
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
border: 1px solid var(--line);
|
|
border-radius: 6px;
|
|
padding: 0.35rem 0.5rem;
|
|
font: inherit;
|
|
}
|
|
button {
|
|
background: var(--accent);
|
|
color: #06121f;
|
|
border: 0;
|
|
border-radius: 6px;
|
|
padding: 0.4rem 0.9rem;
|
|
font: inherit;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
button:hover { filter: brightness(1.1); }
|
|
button.danger { background: var(--danger); color: #1a0606; }
|
|
code { background: var(--bg); padding: 0.05rem 0.3rem; border-radius: 4px; }
|
|
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
|
|
.actions form { margin: 0; }
|