Perk-a-cola redesign + surface RCON map/gametype/roster/health

Themes the fleet manager around the Electric Cherry perk-a-cola from Mob of
the Dead — cherry-red art-deco label with electric cyan discharge. New
design tokens (Alfa Slab One + Inter + JetBrains Mono, self-hosted), full
redesign of layout/dashboard/cards/detail page, tokens pass on
deployments/betas/pipeline/beta/diff, cherry+lightning favicon.

Lights up server data that RCON was already fetching but the UI dropped.
parsePlayerRoster() extracts num/score/ping/guid/name from both status
dialects. Worker persists last_map/last_gametype/last_roster/last_seen_at/
last_error (new columns with idempotent boot-time ALTERs) and emits them
over SSE. Fleet cards now show health dot, map · gametype, top-3 roster
preview, and last-seen. Detail page adds a sortable full roster with
distinct empty-lobby vs offline states. New health classifier
(online/stale/offline) drives the visual state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-09-12 08:20:54 -04:00
co-authored by Claude Opus 4.7
parent 854f5532a9
commit 9bff47a9a4
29 changed files with 1636 additions and 356 deletions
+23
View File
@@ -6,6 +6,28 @@ import schemaSql from './schema.sql?raw';
let _db: Database.Database | null = null;
// Columns that were added to `servers` after v0.1 shipped. Applied on every
// boot; better-sqlite3 has no `ADD COLUMN IF NOT EXISTS`, so we run each and
// swallow the "duplicate column" error.
const SERVERS_MIGRATIONS: Array<{ column: string; ddl: string }> = [
{ column: 'last_map', ddl: 'ALTER TABLE servers ADD COLUMN last_map TEXT' },
{ column: 'last_gametype', ddl: 'ALTER TABLE servers ADD COLUMN last_gametype TEXT' },
{ column: 'last_roster', ddl: 'ALTER TABLE servers ADD COLUMN last_roster TEXT' },
{ column: 'last_seen_at', ddl: 'ALTER TABLE servers ADD COLUMN last_seen_at TEXT' },
{ column: 'last_error', ddl: 'ALTER TABLE servers ADD COLUMN last_error TEXT' }
];
function migrateServers(handle: Database.Database): void {
for (const m of SERVERS_MIGRATIONS) {
try {
handle.exec(m.ddl);
} catch (err) {
const msg = (err as Error).message ?? '';
if (!/duplicate column name/i.test(msg)) throw err;
}
}
}
export function db(): Database.Database {
if (_db) return _db;
@@ -14,6 +36,7 @@ export function db(): Database.Database {
_db.pragma('journal_mode = WAL');
_db.pragma('foreign_keys = ON');
_db.exec(schemaSql);
migrateServers(_db);
return _db;
}