Initial commit — SvelteKit fleet manager for T5 Plutonium servers
Ports push_scripts.sh (1497 lines of bash) to a SvelteKit + SQLite web app that manages a fleet of T5 Plutonium servers running on Komodo. Same push and beta workflow as the shell script, with a live SSE pipeline view, a !rt-token-gated auth modal that hard-pauses deployments on stale tokens, per-file audit diffs, and a Komodo-container deployment target. - Push/beta engines port the exact filter, held-by-beta, conflict, and stale-backup rules from the shell script - SQLite (better-sqlite3) replaces script_metadata.json; a one-shot importer moves legacy state over on first boot - 16 vitest tests cover push add/update/skip, beta open→rollback, open→promote, conflict guards, sweep frozen/manual branches, and IW4M login/status parsing - docker/ + komodo/stack.toml deploy as a managed container on the same host as the game servers, /root/zombies bind-mounted at the same path the shell script used
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
<script lang="ts">
|
||||
interface Held {
|
||||
target: string;
|
||||
slug: string;
|
||||
}
|
||||
interface Props {
|
||||
name: string;
|
||||
players?: number | null;
|
||||
held?: Held[];
|
||||
lastRestartedAt?: string | null;
|
||||
restarting?: boolean;
|
||||
}
|
||||
let { name, players = null, held = [], lastRestartedAt = null, restarting = false }: Props = $props();
|
||||
|
||||
function ago(iso: string | null): string {
|
||||
if (!iso) return 'never';
|
||||
const d = Date.now() - new Date(iso).getTime();
|
||||
if (d < 60_000) return 'just now';
|
||||
if (d < 3_600_000) return `${Math.floor(d / 60_000)}m ago`;
|
||||
if (d < 86_400_000) return `${Math.floor(d / 3_600_000)}h ago`;
|
||||
return `${Math.floor(d / 86_400_000)}d ago`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<a class="card" href="/servers/{name}" class:restarting>
|
||||
<div class="head">
|
||||
<strong>{name}</strong>
|
||||
<span class="players" class:has-players={players !== null && players > 0}>
|
||||
{players ?? '—'}
|
||||
</span>
|
||||
</div>
|
||||
<div class="meta">
|
||||
restart: {ago(lastRestartedAt)}
|
||||
</div>
|
||||
{#if held.length > 0}
|
||||
<div class="held">
|
||||
{#each held as h (h.target)}
|
||||
<span class="chip" title="held by beta: {h.slug}">β {h.target}</span>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{#if restarting}
|
||||
<div class="restarting-bar" aria-label="restarting"></div>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
display: block;
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
color: #ddd;
|
||||
text-decoration: none;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.card:hover { border-color: #555; }
|
||||
.card.restarting { border-color: #ffab00; }
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
}
|
||||
.players {
|
||||
background: #222;
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
font-family: ui-monospace, monospace;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
.players.has-players { background: #2d4a2d; color: #a8e6a8; }
|
||||
.meta { color: #666; font-size: 12px; margin-top: 4px; }
|
||||
.held { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
|
||||
.chip {
|
||||
background: #3a2f00;
|
||||
color: #ffcc55;
|
||||
border: 1px solid #665500;
|
||||
border-radius: 3px;
|
||||
padding: 1px 6px;
|
||||
font-size: 11px;
|
||||
font-family: ui-monospace, monospace;
|
||||
}
|
||||
.restarting-bar {
|
||||
height: 2px;
|
||||
background: linear-gradient(90deg, transparent, #ffab00, transparent);
|
||||
margin-top: 8px;
|
||||
animation: slide 1.2s infinite linear;
|
||||
}
|
||||
@keyframes slide {
|
||||
from { background-position: -100% 0; }
|
||||
to { background-position: 200% 0; }
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user