perf(web): stream dashboard tile events

This commit is contained in:
vince 2026-06-20 15:23:14 +02:00
parent a66f1fdd57
commit 41fb964ebb
7 changed files with 315 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import { extname, normalize } from "node:path";
import { handleAgentDashboardRoute } from "./routes/agent-dashboard";
import {
handleDashboardEventsRoute,
handleDashboardRoute,
handleDashboardTileRoute,
handleDashboardTilesRoute,
@ -32,6 +33,11 @@ export async function handleRequest(request: Request): Promise<Response> {
return handleDashboardTilesRoute(request);
}
if (url.pathname === "/api/dashboard/events") {
if (request.method !== "GET") return methodNotAllowed(["GET"]);
return handleDashboardEventsRoute({ signal: request.signal });
}
if (url.pathname.startsWith("/api/dashboard/tile/")) {
if (request.method !== "GET") return methodNotAllowed(["GET"]);
return handleDashboardTileRoute(url.pathname);