config and plugin
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user