Bound provisioning history and poll only active operations

This commit is contained in:
2026-10-05 14:52:30 -04:00
parent 16a5bc3534
commit 041c024f95
11 changed files with 279 additions and 44 deletions
+14 -3
View File
@@ -1,10 +1,21 @@
import { json } from '@sveltejs/kit';
import { listDeployments } from '$lib/server/provisioning/index.js';
import { deploymentListPage } from '$lib/server/provisioning/history.js';
import { requestLifecycle } from '$lib/server/provisioning/index.js';
import { runtimeActions, type RuntimeAction } from '$lib/provisioning.js';
import { provisioningActions, runtimeActions, type ProvisioningAction, type RuntimeAction } from '$lib/provisioning.js';
import { kick } from '$lib/server/pipeline/worker.js';
export function GET() { return json({ deployments: listDeployments() }); }
export function GET({ url }: { url: URL }) {
const params = url.searchParams;
const action = params.get('action');
return json(deploymentListPage({
view: params.get('view') === 'history' ? 'history' : 'active',
action: provisioningActions.includes(action as ProvisioningAction) ? action as ProvisioningAction : undefined,
status: params.get('status') === 'attention' ? 'attention' : undefined,
server: params.get('server') ?? '',
limit: Number(params.get('limit') ?? 25),
offset: Number(params.get('offset') ?? 0)
}), { headers: { 'Cache-Control': 'no-store' } });
}
export async function POST({ request }: { request: Request }) {
const body = await request.json().catch(() => null);