config and plugin

This commit is contained in:
2026-09-12 19:11:44 -04:00
parent 85bcb05a7d
commit 8c40bbeff1
19 changed files with 1685 additions and 86 deletions
+12 -7
View File
@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
type ArtifactKind = 'script' | 'config' | 'plugin' | 'baseline';
interface BetaListRow {
id: number;
state: 'running' | 'ready-promote' | 'promoted' | 'rolled-back';
@@ -13,6 +14,7 @@
id: number;
name: string;
target_rel_path: string;
kind: ArtifactKind;
version: { id: number; version: number; sha256: string } | null;
}>;
servers: Array<{ server: string; stage: string; error: string | null }>;
@@ -25,6 +27,7 @@
scope_type: 'game' | 'map' | null;
scope_value: string | null;
current_version_id: number | null;
kind: ArtifactKind;
latestVersion: {
id: number;
version: number;
@@ -229,12 +232,14 @@
);
function summarizeScripts(b: BetaListRow): string {
if (b.scripts.length === 0) return '(no scripts)';
if (b.scripts.length === 0) return '(no artifacts)';
if (b.scripts.length === 1) {
const s = b.scripts[0];
return `${s.name} · v${s.version?.version ?? '?'}`;
return `[${s.kind}] ${s.name} · v${s.version?.version ?? '?'}`;
}
return `${b.scripts.length} scripts`;
const byKind: Record<string, number> = {};
for (const s of b.scripts) byKind[s.kind] = (byKind[s.kind] ?? 0) + 1;
return Object.entries(byKind).map(([k, n]) => `${n} ${k}${n === 1 ? '' : 's'}`).join(', ');
}
</script>
@@ -246,7 +251,7 @@
<section class="panel">
<h2>Open a beta</h2>
{#if eligibleScripts.length === 0}
<p class="empty">no scripts with untested versions — upload a new version from a script's page</p>
<p class="empty">no artifacts with untested versions — upload a new version from a scripts / configs / plugins page</p>
{:else}
<form onsubmit={openNewBeta} class="new-beta-form">
<div class="picks">
@@ -256,9 +261,9 @@
bind:value={row.scriptId}
onchange={() => onPickScript(idx)}
>
<option value={null}>— pick a script —</option>
<option value={null}>— pick an artifact —</option>
{#each eligibleForRow(idx) as s (s.id)}
<option value={s.id}>{s.name}</option>
<option value={s.id}>[{s.kind}] {s.name}</option>
{/each}
</select>
<select bind:value={row.versionId} disabled={row.scriptId === null}>
@@ -280,7 +285,7 @@
</div>
{/each}
</div>
<button type="button" class="add-row" onclick={addRow}>+ add script</button>
<button type="button" class="add-row" onclick={addRow}>+ add artifact</button>
<label>
<span class="k">test servers</span>
+4 -2
View File
@@ -32,6 +32,7 @@
id: number;
name: string;
target_rel_path: string;
kind: 'script' | 'config' | 'plugin' | 'baseline';
version: { id: number; version: number; sha256: string } | null;
}
@@ -118,13 +119,14 @@
</div>
<section class="panel">
<h2>Scripts · {scripts.length}</h2>
<h2>Artifacts · {scripts.length}</h2>
{#if scripts.length === 0}
<p class="empty">no scripts bundled in this beta</p>
<p class="empty">no artifacts bundled in this beta</p>
{:else}
<div class="script-list">
{#each scripts as s (s.id)}
<div class="script-row">
<span class="s-kind mono">[{s.kind}]</span>
<a class="s-name" href="/scripts/{s.id}">{s.name}</a>
<span class="s-target mono">{s.target_rel_path}</span>
<span class="s-ver mono">v{s.version?.version ?? '?'}</span>