Bound provisioning history and poll only active operations
This commit is contained in:
@@ -1,3 +1 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { listDeployments } from '$lib/server/provisioning/index.js';
|
||||
export function GET() { return json({ deployments: listDeployments() }); }
|
||||
export { GET } from '../provisioning/+server.js';
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user