fleet(tower): 0.18 — Tasks-View (Spool/Dead-Letter/Alarm) + Task-Detail-Modal + /healthz + /api/status; Fleet-Views 0.13-0.18 erstmals versioniert

This commit is contained in:
Hermes CEO
2026-10-30 04:55:35 +00:00
parent fa3d5d0a8f
commit 9e94512214
33 changed files with 3498 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
import { NextResponse } from "next/server"
import { readJournalTail } from "@/app/lib/fleet/fleetSource"
export const dynamic = "force-dynamic"
/**
* GET /api/fleet/escalations — HITL-/Escalation-Historie (Kernfeature 4):
* Journal-Filter auf type=escalation + rejected-Events (Quarantine).
* Kein psql — Escalations sind Spool-Envelopes, die DB bleibt reiner Index.
*/
export async function GET() {
try {
const tail = readJournalTail(500)
const escalations = tail.filter(
(l) => l.event === "accepted" && l.type === "escalation"
)
const rejected = tail.filter((l) => l.event === "rejected")
return NextResponse.json(
{
escalations: escalations.reverse(),
rejected: rejected.reverse(),
counts: { escalations: escalations.length, rejected: rejected.length },
},
{ headers: { "Cache-Control": "no-store" } }
)
} catch (err) {
return NextResponse.json(
{ error: `FLEET_ESCALATIONS_FAILED: ${err instanceof Error ? err.message : String(err)}` },
{ status: 500 }
)
}
}