multi script beta

This commit is contained in:
2026-09-12 18:23:56 -04:00
parent 30e59c900c
commit 85bcb05a7d
16 changed files with 1053 additions and 516 deletions
+14 -4
View File
@@ -1,5 +1,5 @@
import { json } from '@sveltejs/kit';
import { getBeta, listBetaServers } from '$lib/server/fleet/beta.js';
import { getBeta, listBetaServers, listBetaScripts } from '$lib/server/fleet/beta.js';
import { getScript, getVersion } from '$lib/server/fleet/scripts.js';
function parseId(raw: string): number | null {
@@ -13,9 +13,19 @@ export async function GET({ params }: { params: { id: string } }) {
const beta = getBeta(id);
if (!beta) return json({ ok: false, error: 'not found' }, { status: 404 });
const script = getScript(beta.script_id);
const version = getVersion(beta.script_version_id);
const scripts = listBetaScripts(id).map((bs) => {
const script = getScript(bs.script_id);
const version = getVersion(bs.script_version_id);
return {
id: bs.script_id,
name: script?.name ?? '(deleted)',
target_rel_path: script?.target_rel_path ?? '',
version: version
? { id: version.id, version: version.version, sha256: version.sha256 }
: null
};
});
const servers = listBetaServers(id);
return json({ beta, script, version, servers });
return json({ beta, scripts, servers });
}