Move host operation history to a paginated Hosts page

This commit is contained in:
2026-10-05 12:27:48 -04:00
parent 09ef8c6ec8
commit 10ab071bce
14 changed files with 298 additions and 17 deletions
@@ -0,0 +1,10 @@
import { error, json } from '@sveltejs/kit';
import { listHostOperationHistory } from '$lib/server/hosts/index.js';
import { requireManagementOrigin } from '$lib/server/hosts/http.js';
export function GET({ request }: { request: Request }) {
requireManagementOrigin(request);
const page = Number(new URL(request.url).searchParams.get('page') ?? '1');
if (!Number.isSafeInteger(page) || page < 1) error(400, 'Invalid operation history page.');
return json(listHostOperationHistory(page), { headers: { 'Cache-Control': 'no-store' } });
}