feat(runbook): Notfall-Runbook + Inline-Hints an Alarm-Flaechen (CHO tower-notfall-runbook)
DATEI 1: public/runbook/runbook-tower-notfall.md (statisch, Anker #deadman/#spool/#deadletter/#health)
DATEI 2: /runbook-Route (Server Component, Mini-MD-Renderer, CSP-konform, force-static)
DATEI 3: runbookHints.ts (LAMP_HINTS/buildView/renderHintHtml 1:1 aus runbook_hints.py)
+ RunbookHint.tsx eingebunden an 4 Alarm-Flaechen:
- EscalationHistory (Deadman, Szenario A)
- TaskBrowser Spool-Tab (Szenario B) + Dead-Letter-Tab (B3)
- TaskBrowser/OpsPanels Degraded/Error (Health, Szenario C)
Keine Ampelfarben/Deadman-Logik/Degraded-Banner/Datenpfade angefasst (CHO-NICHT ANFASSEN erfuellt).
Build verifiziert: tsc --noEmit clean, next build gruen (/runbook static).
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect, useState } from "react"
|
||||
import RunbookHint from "./RunbookHint"
|
||||
import { hintByKey } from "@/app/lib/fleet/runbookHints"
|
||||
|
||||
/**
|
||||
* EscalationHistory — Kernfeature 4: HITL-/Escalation-Historie.
|
||||
@@ -93,6 +95,7 @@ export default function EscalationHistory() {
|
||||
<h2 className="text-[10px] uppercase tracking-wider text-[var(--status-stopped)] mb-3">
|
||||
HITL-Alarme (type=escalation)
|
||||
</h2>
|
||||
<RunbookHint hint={hintByKey("deadman")} />
|
||||
{esc.length === 0 ? (
|
||||
<p className="text-xs text-[var(--foreground-dim)] font-mono py-4 text-center">
|
||||
Keine Alarme — alles ruhig
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* Keine Mutation, keine Netz-Grants, 30 s Auto-Refresh.
|
||||
*/
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import RunbookHint from './RunbookHint'
|
||||
import { hintByKey } from '@/app/lib/fleet/runbookHints'
|
||||
|
||||
const REFRESH_MS = 30_000
|
||||
|
||||
@@ -190,6 +192,7 @@ export default function OpsPanels() {
|
||||
Datenquelle eingeschraenkt: {err}
|
||||
</p>
|
||||
)}
|
||||
{err && <RunbookHint hint={hintByKey("health")} />}
|
||||
</div>
|
||||
|
||||
{tab === 'nar' && (
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
"use client"
|
||||
|
||||
/**
|
||||
* RunbookHint.tsx — statischer Inline-Hint an den Alarm-Flaechen des Towers.
|
||||
* Portierung der render_hint_html()-Semantik als React-Komponente
|
||||
* (Karte tower-notfall-runbook, DATEI 3). Rein statisch: kein Polling,
|
||||
* kein Egress, keine Secrets — nur interner Deep-Link auf /runbook#<anker>.
|
||||
*/
|
||||
|
||||
import type { LampHint } from "@/app/lib/fleet/runbookHints"
|
||||
|
||||
export default function RunbookHint({ hint }: { hint: LampHint }) {
|
||||
return (
|
||||
<div
|
||||
id={`hint-${hint.key}`}
|
||||
className="lamp-hint text-xs leading-snug text-[var(--foreground-dim)]"
|
||||
data-component={hint.component}
|
||||
data-testid={`runbook-hint-${hint.key}`}
|
||||
>
|
||||
<span className="lh-title block font-semibold text-[var(--foreground)]">
|
||||
Notfall {hint.scenario} — {hint.title}
|
||||
</span>
|
||||
<ol className="lh-steps my-0.5 ml-4 list-decimal">
|
||||
{hint.kurzschritte.map((s: string) => (
|
||||
<li key={s}>{s}</li>
|
||||
))}
|
||||
</ol>
|
||||
<div className="lh-esc mt-0.5">
|
||||
<strong>Eskalation:</strong> {hint.eskalation}
|
||||
</div>
|
||||
<a
|
||||
className="lh-link text-[#93c5fd] underline hover:text-[#a5ccff]"
|
||||
href={`/runbook${hint.anchor}`}
|
||||
>
|
||||
Vollständiges Runbook →
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -13,6 +13,8 @@
|
||||
* Polt 30 s; degradierte Quelle -> Banner statt Leeranzeige.
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from "react"
|
||||
import RunbookHint from "./RunbookHint"
|
||||
import { hintByKey } from "@/app/lib/fleet/runbookHints"
|
||||
|
||||
type TaskEnvelope = {
|
||||
task_id: string
|
||||
@@ -253,11 +255,26 @@ export default function TaskBrowser() {
|
||||
Tasks nicht ladbar: {loadError}
|
||||
</div>
|
||||
)}
|
||||
{tab === "spool" && (
|
||||
<div className="mt-4 border border-[var(--border)] bg-[var(--background-tertiary)] p-3">
|
||||
<RunbookHint hint={hintByKey("spool")} />
|
||||
</div>
|
||||
)}
|
||||
{tab === "dead-letter" && (
|
||||
<div className="mt-4 border border-[var(--border)] bg-[var(--background-tertiary)] p-3">
|
||||
<RunbookHint hint={hintByKey("deadletter")} />
|
||||
</div>
|
||||
)}
|
||||
{data?.degraded && (
|
||||
<div className="mt-4 border border-amber-500 bg-[var(--background-tertiary)] p-3 text-xs text-amber-400">
|
||||
DEGRADED: {data.degraded_reason || "Quelle gestoert"} — Anzeige evtl. unvollstaendig.
|
||||
</div>
|
||||
)}
|
||||
{(loadError || data?.degraded) && (
|
||||
<div className="mt-4 border border-[var(--border)] bg-[var(--background-tertiary)] p-3">
|
||||
<RunbookHint hint={hintByKey("health")} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="mt-4 overflow-x-auto">
|
||||
{tab === "alarm" ? (
|
||||
|
||||
Reference in New Issue
Block a user