feat: dashboard WebSocket push + page-routes refactor

This commit is contained in:
unknown
2026-03-17 14:30:43 +01:00
parent 1631801232
commit af6706ea81
8 changed files with 282 additions and 347 deletions
@@ -26,6 +26,7 @@ import {
getUserClientAccessScope,
listUserClientRuleIdsByAccess,
} from "../../users";
import { notifyDashboardViewers } from "../../sessions/sessionManager";
type RequestIpProvider = {
requestIP: (req: Request) => { address?: string } | null | undefined;
@@ -275,6 +276,7 @@ export async function handleClientRoutes(
}
deleteClientRow(targetId);
notifyDashboardViewers();
const ip = server.requestIP(req)?.address || "unknown";
logAudit({
@@ -331,6 +333,7 @@ export async function handleClientRoutes(
if (!updated) {
return Response.json({ error: "Client not found" }, { status: 404 });
}
notifyDashboardViewers();
const ip = server.requestIP(req)?.address || "unknown";
logAudit({
@@ -389,6 +392,7 @@ export async function handleClientRoutes(
if (!updated) {
return Response.json({ error: "Client not found" }, { status: 404 });
}
notifyDashboardViewers();
const ip = server.requestIP(req)?.address || "unknown";
logAudit({