fix(alerts): 補齊處置結果與人工通知契約
Some checks failed
CD Pipeline / tests (push) Failing after 45s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 12s

This commit is contained in:
Your Name
2026-05-31 15:41:09 +08:00
parent 03f2abf576
commit 3d8b395032
14 changed files with 888 additions and 75 deletions

View File

@@ -17,6 +17,22 @@ export interface AwoooPStatusChain {
verification?: string | null;
needs_human?: boolean | null;
next_step?: string | null;
operator_outcome?: {
schema_version?: string;
state?: string | null;
severity?: string | null;
summary_zh?: string | null;
needs_human?: boolean | null;
human_action_required?: boolean | null;
human_action_reason?: string | null;
next_action?: string | null;
notification?: {
mode?: string | null;
channels?: string[];
telegram?: string | null;
awooop?: string | null;
};
} | null;
blockers?: string[];
fetch_error?: string | null;
evidence?: {
@@ -199,6 +215,7 @@ export function AwoooPStatusChainPanel({
const tone = toneClass(chain);
const emptyLabel = t("emptyValue");
const evidence = chain?.evidence ?? {};
const outcome = chain?.operator_outcome;
const blockers = chain?.blockers ?? [];
const sourceCorrelation = chain?.source_refs?.correlation;
@@ -222,7 +239,7 @@ export function AwoooPStatusChainPanel({
{ label: t("fields.stage"), value: `${valueOrEmpty(chain.current_stage, emptyLabel)} / ${valueOrEmpty(chain.stage_status, emptyLabel)}` },
{ label: t("fields.repair"), value: valueOrEmpty(chain.repair_state, emptyLabel) },
{ label: t("fields.verification"), value: valueOrEmpty(chain.verification, emptyLabel) },
{ label: t("fields.nextStep"), value: valueOrEmpty(chain.next_step, emptyLabel) },
{ label: t("fields.nextStep"), value: valueOrEmpty(outcome?.next_action ?? chain.next_step, emptyLabel) },
];
const evidenceMetrics = [
{ label: t("evidence.autoRepair"), value: evidence.auto_repair_records ?? 0 },
@@ -457,6 +474,29 @@ export function AwoooPStatusChainPanel({
))}
</div>
{outcome && (
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-4">
<div className="min-w-0 bg-white px-4 py-3 md:col-span-2">
<p className="text-xs font-semibold text-[#77736a]">{t("outcome.summary")}</p>
<p className="mt-2 truncate text-sm font-semibold text-[#141413]" title={valueOrEmpty(outcome.summary_zh, emptyLabel)}>
{valueOrEmpty(outcome.summary_zh, emptyLabel)}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("outcome.notification")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={(outcome.notification?.channels ?? []).join(", ") || emptyLabel}>
{(outcome.notification?.channels ?? []).join(", ") || emptyLabel}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("outcome.reason")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={valueOrEmpty(outcome.human_action_reason, emptyLabel)}>
{valueOrEmpty(outcome.human_action_reason, emptyLabel)}
</p>
</div>
</div>
)}
{!compact && (
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-5">
{evidenceMetrics.map((item) => (