@@ -101,7 +101,7 @@ export function OpsDiagnosticsWorkspace({ accessToken, accounts }: { accessToken
{ canOperate ? < section className = "diagnostic-jobs acceptance-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > RELEASE CANDIDATE EVIDENCE < / p > < h3 > 发 布 候 选 验 收 快 照 < / h3 > < p > 一 次 冻 结 候 选 构 建 、 迁 移 、 必 需 依 赖 、 联 调 问 题 、 可 靠 任 务 和 严 重 告 警 ; 输 出 仅 是 技 术 预 检 证 据 , 不 代 替 发 布 批 准 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportAcceptanceSnapshot ( event ) } > < label > < span > 候 选 版 本 < / span > < input required maxLength = { 128 } pattern = "[A-Za-z0-9][A-Za-z0-9._+\-]*" value = { acceptanceDraft . candidate_version } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , candidate_version :event.target.value } ) } placeholder = "如 0.55.0-rc.1" / > < / label > < label > < span > 构 建 摘 要 < / span > < input required pattern = "sha256:[A-Fa-f0-9]{64}" value = { acceptanceDraft . build_digest } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , build_digest :event.target.value } ) } placeholder = "sha256: 后跟64位十六进制" / > < / label > < label > < span > 目 标 环 境 < / span > < select value = { acceptanceDraft . environment } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , environment :event.target.value as OpsAcceptanceSnapshotRequest [ "environment" ] } ) } > < option value = "LAB" > 实 验 室 < / option > < option value = "STAGING" > 预 发 布 < / option > < option value = "PRODUCTION" > 生 产 < / option > < / select > < / label > < label > < span > 验 收 类 型 < / span > < select value = { acceptanceDraft . run_type } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , run_type :event.target.value as OpsAcceptanceSnapshotRequest [ "run_type" ] } ) } > < option value = "REAL_DEVICE_PROVIDER" > 真 实 设 备 与 供 应 商 < / option > < option value = "PILOT" > 灰 度 试 点 < / option > < option value = "PRODUCTION_RELEASE" > 生 产 发 布 < / option > < / select > < / label > < label > < span > 验 收 范 围 < / span > < textarea required maxLength = { 500 } value = { acceptanceDraft . scope } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , scope :event.target.value } ) } / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { acceptanceDraft . reason } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , reason :event.target.value } ) } / > < / label > < fieldset > < legend > 本 次 必 需 依 赖 < / legend > { ( [ "oidc_jwks" , "ark_tls" , "volc_rtc_tls" , "content_safety_tls" ] as const ) . map ( ( dependency ) = > < label className = "checkbox-label" key = { dependency } > < input type = "checkbox" checked = { acceptanceDraft . required_dependencies . includes ( dependency ) } onChange = { ( ) = > toggleAcceptanceDependency ( dependency ) } / > { externalDependencyLabel ( dependency ) } < / label > ) } < / fieldset > < button type = "submit" disabled = { busy || ! acceptanceDraft . candidate_version . trim ( ) || ! acceptanceDraft . build_digest . trim ( ) || ! acceptanceDraft . scope . trim ( ) || ! acceptanceDraft . reason . trim ( ) || acceptanceDraft . required_dependencies . length === 0 } > { busy ? "生成中…" : "生成并下载快照" } < / button > < / form > { acceptanceResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { acceptanceResult . candidate_version } < / h4 > < p > { formatTimestamp ( acceptanceResult . generated_at ) } · 快 照 { acceptanceResult . id } < / p > < / div > < span className = { ` status ${ acceptanceResult . overall_gate_satisfied ? "active" : "danger" } ` } > { acceptanceResult . overall_gate_satisfied ? "技术门禁通过" : "技术门禁阻断" } < / span > < / div > < div className = "issue-summary-grid" > { acceptanceResult . gates . map ( ( gate ) = > < article className = { gate . satisfied ? "issue-gate-pass" : "issue-gate-blocked" } key = { gate . code } > < span > { acceptanceGateLabel ( gate . code ) } < / span > < strong > { gate . satisfied ? "通过" : "阻断" } < / strong > < small > { gate . summary } < / small > < / article > ) } < / div > { acceptanceResult . alerts . blocking_items . length ? < div className = "diagnostic-results" > < h4 > 阻 断 告 警 定 位 < / h4 > { acceptanceResult . alerts . blocking_items . map ( ( alert ) = > < article className = "diagnostic-card" key = { alert . id } > < div className = "diagnostic-card__head" > < div > < strong > { alert . rule_code } < / strong > < span > 告 警 { alert . id } · 最 近 命 中 { formatTimestamp ( alert . last_detected_at ) } < / span > < / div > < span className = { ` status ${ alert . severity === "CRITICAL" ? "danger" : "warning" } ` } > { alert . severity } < / span > < / div > < dl > < div > < dt > 处 置 状 态 < / dt > < dd > { alert . status } < / dd > < / div > < div > < dt > 关 联 类 型 < / dt > < dd > { alert . resource_type || "聚合队列" } < / dd > < / div > < div > < dt > 关 联 编 号 < / dt > < dd > { alert . resource_id || "—" } < / dd > < / div > < div > < dt > 资 源 核 对 < / dt > < dd > { acceptanceResourceStateLabel ( alert . resource_state ) } < / dd > < / div > < / dl > < / article > ) } < / div > : < p className = "empty-copy" > 当 前 没 有 阻 断 发 布 的 HIGH或CRITICAL告警 。 < / p > } { acceptanceResult . alerts . blocking_items_truncated ? < p className = "recording-notice recording-notice--error" > 阻 断 告 警 超 过 100 条 , 下 载 文 件 仅 包 含 最 早 100 条 ; 必 须 在 告 警 工 作 台 查 看 完 整 队 列 。 < / p > : null } < p className = "empty-copy" > { acceptanceResult . disclaimer } < / p > < / div > : null } < / section > : null }
{ canOperate ? < section className = "diagnostic-jobs acceptance-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > RELEASE CANDIDATE EVIDENCE < / p > < h3 > 发 布 候 选 验 收 快 照 < / h3 > < p > 一 次 冻 结 候 选 构 建 、 迁 移 、 必 需 依 赖 、 联 调 问 题 、 可 靠 任 务 和 严 重 告 警 ; 输 出 仅 是 技 术 预 检 证 据 , 不 代 替 发 布 批 准 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportAcceptanceSnapshot ( event ) } > < label > < span > 候 选 版 本 < / span > < input required maxLength = { 128 } pattern = "[A-Za-z0-9][A-Za-z0-9._+\-]*" value = { acceptanceDraft . candidate_version } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , candidate_version :event.target.value } ) } placeholder = "如 0.55.0-rc.1" / > < / label > < label > < span > 构 建 摘 要 < / span > < input required pattern = "sha256:[A-Fa-f0-9]{64}" value = { acceptanceDraft . build_digest } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , build_digest :event.target.value } ) } placeholder = "sha256: 后跟64位十六进制" / > < / label > < label > < span > 目 标 环 境 < / span > < select value = { acceptanceDraft . environment } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , environment :event.target.value as OpsAcceptanceSnapshotRequest [ "environment" ] } ) } > < option value = "LAB" > 实 验 室 < / option > < option value = "STAGING" > 预 发 布 < / option > < option value = "PRODUCTION" > 生 产 < / option > < / select > < / label > < label > < span > 验 收 类 型 < / span > < select value = { acceptanceDraft . run_type } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , run_type :event.target.value as OpsAcceptanceSnapshotRequest [ "run_type" ] } ) } > < option value = "REAL_DEVICE_PROVIDER" > 真 实 设 备 与 供 应 商 < / option > < option value = "PILOT" > 灰 度 试 点 < / option > < option value = "PRODUCTION_RELEASE" > 生 产 发 布 < / option > < / select > < / label > < label > < span > 验 收 范 围 < / span > < textarea required maxLength = { 500 } value = { acceptanceDraft . scope } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , scope :event.target.value } ) } / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { acceptanceDraft . reason } onChange = { ( event ) = > setAcceptanceDraft ( { . . . acceptanceDraft , reason :event.target.value } ) } / > < / label > < fieldset > < legend > 本 次 必 需 依 赖 < / legend > { ( [ "oidc_jwks" , "ark_tls" , "volc_rtc_tls" , "content_safety_tls" ] as const ) . map ( ( dependency ) = > < label className = "checkbox-label" key = { dependency } > < input type = "checkbox" checked = { acceptanceDraft . required_dependencies . includes ( dependency ) } onChange = { ( ) = > toggleAcceptanceDependency ( dependency ) } / > { externalDependencyLabel ( dependency ) } < / label > ) } < / fieldset > < button type = "submit" disabled = { busy || ! acceptanceDraft . candidate_version . trim ( ) || ! acceptanceDraft . build_digest . trim ( ) || ! acceptanceDraft . scope . trim ( ) || ! acceptanceDraft . reason . trim ( ) || acceptanceDraft . required_dependencies . length === 0 } > { busy ? "生成中…" : "生成并下载快照" } < / button > < / form > { acceptanceResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { acceptanceResult . candidate_version } < / h4 > < p > { formatTimestamp ( acceptanceResult . generated_at ) } · 快 照 { acceptanceResult . id } < / p > < / div > < span className = { ` status ${ acceptanceResult . overall_gate_satisfied ? "active" : "danger" } ` } > { acceptanceResult . overall_gate_satisfied ? "技术门禁通过" : "技术门禁阻断" } < / span > < / div > < div className = "issue-summary-grid" > { acceptanceResult . gates . map ( ( gate ) = > < article className = { gate . satisfied ? "issue-gate-pass" : "issue-gate-blocked" } key = { gate . code } > < span > { acceptanceGateLabel ( gate . code ) } < / span > < strong > { gate . satisfied ? "通过" : "阻断" } < / strong > < small > { gate . summary } < / small > < / article > ) } < / div > { acceptanceResult . alerts . blocking_items . length ? < div className = "diagnostic-results" > < h4 > 阻 断 告 警 定 位 < / h4 > { acceptanceResult . alerts . blocking_items . map ( ( alert ) = > < article className = "diagnostic-card" key = { alert . id } > < div className = "diagnostic-card__head" > < div > < strong > { alert . rule_code } < / strong > < span > 告 警 { alert . id } · 最 近 命 中 { formatTimestamp ( alert . last_detected_at ) } < / span > < / div > < span className = { ` status ${ alert . severity === "CRITICAL" ? "danger" : "warning" } ` } > { alert . severity } < / span > < / div > < dl > < div > < dt > 处 置 状 态 < / dt > < dd > { alert . status } < / dd > < / div > < div > < dt > 关 联 类 型 < / dt > < dd > { alert . resource_type || "聚合队列" } < / dd > < / div > < div > < dt > 关 联 编 号 < / dt > < dd > { alert . resource_id || "—" } < / dd > < / div > < div > < dt > 资 源 核 对 < / dt > < dd > { acceptanceResourceStateLabel ( alert . resource_state ) } < / dd > < / div > < / dl > < / article > ) } < / div > : < p className = "empty-copy" > 当 前 没 有 阻 断 发 布 的 HIGH或CRITICAL告警 。 < / p > } { acceptanceResult . alerts . blocking_items_truncated ? < p className = "recording-notice recording-notice--error" > 阻 断 告 警 超 过 100 条 , 下 载 文 件 仅 包 含 最 早 100 条 ; 必 须 在 告 警 工 作 台 查 看 完 整 队 列 。 < / p > : null } < p className = "empty-copy" > { acceptanceResult . disclaimer } < / p > < / div > : null } < / section > : null }
{ canOperate ? < section className = "diagnostic-jobs pilot-daily-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > PILOT DAILY OPERATIONS < / p > < h3 > 试 点 运 行 日 报 < / h3 > < p > 按 业 务 时 区 自 然 日 汇 总 设 备 、 通 话 、 供 应 商 、 上 传 、 告 警 和 费 用 ; 下 载 内 容 不 含 字 幕 、 录 音 、 个 人 资 料 和 供 应 商 任 务 编 号 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportPilotDailySnapshot ( event ) } > < label > < span > 业 务 日 期 < / span > < input required type = "date" max = { localDateInput ( ) } value = { pilotDailyDraft . local_date } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , local_date :event.target.value } ) } / > < / label > < label > < span > IANA 时 区 < / span > < input required maxLength = { 80 } value = { pilotDailyDraft . timezone } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , timezone :event.target.value } ) } placeholder = "Asia/Shanghai" / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { pilotDailyDraft . reason } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , reason :event.target.value } ) } / > < / label > < button type = "submit" disabled = { busy || ! pilotDailyDraft . candidate_version . trim ( ) || ! pilotDailyDraft . build_digest . trim ( ) || ! pilotDailyDraft . local_date || ! pilotDailyDraft . timezone . trim ( ) || ! pilotDailyDraft . reason . trim ( ) } > { busy ? "生成中…" : "生成并下载日报" } < / button > < / form > { pilotDailyResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { pilotDailyResult . local_date } < / h4 > < p > { pilotDailyResult . timezone } · { formatTimestamp ( pilotDailyResult . generated_at ) } · 日 报 { pilotDailyResult . id } < / p > < / div > < span className = "status active" > 已 脱 敏 归 档 < / span > < / div > < div className = "issue-summary-grid" > < article > < span > 可 用 设 备 < / span > < strong > { pilotDailyResult . devices . eligible } < / strong > < small > 当 前 在 线 { pilotDailyResult . devices . online } < / small > < / article > < article > < span > 当 日 通 话 < / span > < strong > { pilotDailyResult . conversations . total } < / strong > < small > 失 败 { pilotStatusCount ( pilotDailyResult , "FAILED" ) } < / small > < / article > < article > < span > 上 传 积 压 < / span > < strong > { pilotDailyResult . uploads . open_batches } < / strong > < small > 待 处 理 分 段 { pilotDailyResult . uploads . pending_segments } < / small > < / article > < article className = { pilotDailyResult . alerts . high_open + pilotDailyResult . alerts . critical_open ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 高 严 重 度 告 警 < / span > < strong > { pilotDailyResult . alerts . high_open + pilotDailyResult . alerts . critical_open } < / strong > < small > 全 部 未 关 闭 { pilotDailyResult . alerts . open } < / small > < / article > < / div > < div className = "diagnostic-results" > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 供 应 商 运 行 < / strong > < span > { pilotDailyResult . providers . length } 个 供 应 商 有 运 行 记 录 < / span > < / div > < / div > < p > { pilotDailyResult . providers . length ? pilotDailyResult . providers . map ( ( item ) = > ` ${ item . provider } : ${ item . current_status } ,失败通知 ${ item . failed_events_during_day } ,失败通话 ${ item . failed_calls_during_day } ,积压 ${ item . notification_backlog } ` ) . join ( "; " ) : "所选日期和当前状态中没有供应商记录。" } < / p > < / article > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 当 日 费 用 < / strong > < span > 按 币 种 分 列 , 不 做 汇 率 换 算 < / span > < / div > < / div > < p > { pilotDailyResult . costs . length ? pilotDailyResult . costs . map ( ( item ) = > ` ${ item . currency } ${ ( item . cost_micros / 1 _000_000 ) . toFixed ( 6 ) } ( ${ item . line_count } 条) ` ) . join ( "; " ) : "所选自然日没有费用明细。" } < / p > < / article > < / div > < p className = "empty-copy" > { pilotDailyResult . disclaimer } < / p > < / div > : null } < / section > : null }
{ canOperate ? < section className = "diagnostic-jobs pilot-daily-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > PILOT DAILY OPERATIONS < / p > < h3 > 试 点 运 行 日 报 < / h3 > < p > 按 业 务 时 区 自 然 日 汇 总 设 备 、 通 话 、 供 应 商 、 上 传 、 告 警 和 费 用 ; 下 载 内 容 不 含 字 幕 、 录 音 、 个 人 资 料 和 供 应 商 任 务 编 号 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportPilotDailySnapshot ( event ) } > < label > < span > 业 务 日 期 < / span > < input required type = "date" max = { localDateInput ( ) } value = { pilotDailyDraft . local_date } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , local_date :event.target.value } ) } / > < / label > < label > < span > IANA 时 区 < / span > < input required maxLength = { 80 } value = { pilotDailyDraft . timezone } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , timezone :event.target.value } ) } placeholder = "Asia/Shanghai" / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { pilotDailyDraft . reason } onChange = { ( event ) = > setPilotDailyDraft ( { . . . pilotDailyDraft , reason :event.target.value } ) } / > < / label > < button type = "submit" disabled = { busy || ! pilotDailyDraft . candidate_version . trim ( ) || ! pilotDailyDraft . build_digest . trim ( ) || ! pilotDailyDraft . local_date || ! pilotDailyDraft . timezone . trim ( ) || ! pilotDailyDraft . reason . trim ( ) } > { busy ? "生成中…" : "生成并下载日报" } < / button > < / form > { pilotDailyResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { pilotDailyResult . local_date } < / h4 > < p > { pilotDailyResult . timezone } · { formatTimestamp ( pilotDailyResult . generated_at ) } · 日 报 { pilotDailyResult . id } < / p > < / div > < span className = "status active" > 已 脱 敏 归 档 < / span > < / div > < div className = "issue-summary-grid" > < article > < span > 可 用 设 备 < / span > < strong > { pilotDailyResult . devices . eligible } < / strong > < small > 当 前 在 线 { pilotDailyResult . devices . online } < / small > < / article > < article > < span > 当 日 通 话 < / span > < strong > { pilotDailyResult . conversations . total } < / strong > < small > 失 败 { pilotStatusCount ( pilotDailyResult , "FAILED" ) } < / small > < / article > < article > < span > 上 传 积 压 < / span > < strong > { pilotDailyResult . uploads . open_batches } < / strong > < small > 待 处 理 分 段 { pilotDailyResult . uploads . pending_segments } < / small > < / article > < article className = { pilotDailyResult . alerts . high_open + pilotDailyResult . alerts . critical_open ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 高 严 重 度 告 警 < / span > < strong > { pilotDailyResult . alerts . high_open + pilotDailyResult . alerts . critical_open } < / strong > < small > 全 部 未 关 闭 { pilotDailyResult . alerts . open } < / small > < / article > < / div > < div className = "diagnostic-results" > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 供 应 商 运 行 < / strong > < span > { pilotDailyResult . providers . length } 个 供 应 商 有 运 行 记 录 < / span > < / div > < / div > < p > { pilotDailyResult . providers . length ? pilotDailyResult . providers . map ( ( item ) = > ` ${ item . provider } : ${ item . current_status } ,失败通知 ${ item . failed_events_during_day } ,失败通话 ${ item . failed_calls_during_day } ,积压 ${ item . notification_backlog } ` ) . join ( "; " ) : "所选日期和当前状态中没有供应商记录。" } < / p > < / article > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 当 日 费 用 < / strong > < span > 按 币 种 分 列 , 不 做 汇 率 换 算 < / span > < / div > < / div > < p > { pilotDailyResult . costs . length ? pilotDailyResult . costs . map ( ( item ) = > ` ${ item . currency } ${ ( item . cost_micros / 1 _000_000 ) . toFixed ( 6 ) } ( ${ item . line_count } 条) ` ) . join ( "; " ) : "所选自然日没有费用明细。" } < / p > < / article > < / div > < p className = "empty-copy" > { pilotDailyResult . disclaimer } < / p > < / div > : null } < / section > : null }
{ canOperate ? < section className = "diagnostic-jobs pilot-weekly-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > PILOT WEEKLY REVIEW < / p > < h3 > 试 点 运 行 周 报 < / h3 > < p > 按 周 一 开 始 的 业 务 自 然 周 汇 总 内 容 审 核 、 记 忆 、 隐 私 请 求 、 固 件 和 配 置 差 异 ; 投 诉 仍 需 附 客 服 或 CRM权威证据 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportPilotWeeklySnapshot ( event ) } > < label > < span > 周 开 始 日 期 ( 周 一 ) < / span > < input required type = "date" max = { localDateInput ( ) } value = { pilotWeeklyDraft . week_start } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , week_start :event.target.value } ) } / > < / label > < label > < span > IANA 时 区 < / span > < input required maxLength = { 80 } value = { pilotWeeklyDraft . timezone } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , timezone :event.target.value } ) } placeholder = "Asia/Shanghai" / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { pilotWeeklyDraft . reason } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , reason :event.target.value } ) } / > < / label > < button type = "submit" disabled = { busy || ! pilotWeeklyDraft . candidate_version . trim ( ) || ! pilotWeeklyDraft . build_digest . trim ( ) || ! pilotWeeklyDraft . week_start || ! pilotWeeklyDraft . timezone . trim ( ) || ! pilotWeeklyDraft . reason . trim ( ) } > { busy ? "生成中…" : "生成并下载周报" } < / button > < / form > { pilotWeeklyResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { pilotWeeklyResult . week_start } 起 始 周 < / h4 > < p > { pilotWeeklyResult . timezone } · { formatTimestamp ( pilotWeeklyResult . generated_at ) } · 周 报 { pilotWeeklyResult . id } < / p > < / div > < span className = { ` status ${ pilotWeeklyResult . is_complete ? "active" : "warning" } ` } > { pilotWeeklyResult . is_complete ? "完整自然周" : "周中快照" } < / span > < / div > < div className = "issue-summary-grid" > < article > < span > 人 工 修 订 率 < / span > < strong > { basisPointsLabel ( pilotWeeklyResult . content_review . manual_revision_rate_available , pilotWeeklyResult . content_review . manual_revision_rate_basis_points ) } < / strong > < small > { pilotWeeklyResult . content_review . stories_manually_revised } / { pilotWeeklyResult . content_review . stories_review_touched } 个 审 核 故 事 < / small > < / article > < article > < span > 故 事 确 认 率 < / span > < strong > { basisPointsLabel ( pilotWeeklyResult . content_review . story_confirmation_rate_available , pilotWeeklyResult . content_review . story_confirmation_rate_basis_points ) } < / strong > < small > 确 认 { pilotWeeklyResult . content_review . stories_confirmed } · 拒 绝 { pilotWeeklyResult . content_review . stories_rejected } < / small > < / article > < article > < span > 隐 私 请 求 < / span > < strong > { pilotWeeklyResult . privacy . requests_created_during_week } < / strong > < small > 当 前 未 完 成 { pilotWeeklyResult . privacy . current_open } < / small > < / article > < article className = { pilotWeeklyResult . config . drifted + pilotWeeklyResult . config . unreported ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 配 置 差 异 < / span > < strong > { pilotWeeklyResult . config . drifted + pilotWeeklyResult . config . unreported } < / strong > < small > 一 致 { pilotWeeklyResult . config . aligned } / { pilotWeeklyResult . config . eligible_devices } < / small > < / article > < / div > < div className = "diagnostic-results" > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 记 忆 确 认 与 索 引 < / strong > < span > 首 版 { pilotWeeklyResult . content_review . memories_created } · 修 订 { pilotWeeklyResult . content_review . memory_revisions } < / span > < / div > < / div > < p > 当 前 索 引 待 处 理 { pilotWeeklyResult . content_review . current_memory_index_pending } , 失 败 { pilotWeeklyResult . content_review . current_memory_index_failed } 。 < / p > < / article > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 固 件 分 布 < / strong > < span > { pilotWeeklyResult . firmware_versions . reduce ( ( sum , item ) = > sum + item . device_count , 0 ) } 台 可 用 设 备 < / span > < / div > < / div > < p > { pilotWeeklyResult . firmware_versions . length ? pilotWeeklyResult . firmware_versions . map ( ( item ) = > ` ${ item . model } / ${ item . firmware_version } : ${ item . device_count } 台 ` ) . join ( "; " ) : "当前没有可用且已绑定设备。" } < / p > < / article > < / div > { pilotWeeklyResult . external_evidence . map ( ( item ) = > < p className = "recording-notice recording-notice--error" key = { item . code } > < strong > 外 部 证 据 仍 需 补 充 : 投 诉 < / strong > < br / > { item . reason } < / p > ) } < p className = "empty-copy" > { pilotWeeklyResult . disclaimer } < / p > < / div > : null } < / section > : null }
{ canOperate ? < section className = "diagnostic-jobs pilot-weekly-snapshot" > < div className = "section-heading" > < div > < p className = "eyebrow" > PILOT WEEKLY REVIEW < / p > < h3 > 试 点 运 行 周 报 < / h3 > < p > 按 周 一 开 始 的 业 务 自 然 周 汇 总 内 容 审 核 、 记 忆 、 隐 私 请 求 、 固 件 和 配 置 差 异 ; 投 诉 仍 需 附 客 服 或 CRM权威证据 。 < / p > < / div > < / div > < form className = "integration-issue-form" onSubmit = { ( event ) = > void exportPilotWeeklySnapshot ( event ) } > < label > < span > 周 开 始 日 期 ( 周 一 ) < / span > < input required type = "date" max = { localDateInput ( ) } value = { pilotWeeklyDraft . week_start } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , week_start :event.target.value } ) } / > < / label > < label > < span > IANA 时 区 < / span > < input required maxLength = { 80 } value = { pilotWeeklyDraft . timezone } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , timezone :event.target.value } ) } placeholder = "Asia/Shanghai" / > < / label > < label > < span > 归 档 原 因 < / span > < textarea required maxLength = { 255 } value = { pilotWeeklyDraft . reason } onChange = { ( event ) = > setPilotWeeklyDraft ( { . . . pilotWeeklyDraft , reason :event.target.value } ) } / > < / label > < button type = "submit" disabled = { busy || ! pilotWeeklyDraft . candidate_version . trim ( ) || ! pilotWeeklyDraft . build_digest . trim ( ) || ! pilotWeeklyDraft . week_start || ! pilotWeeklyDraft . timezone . trim ( ) || ! pilotWeeklyDraft . reason . trim ( ) } > { busy ? "生成中…" : "生成并下载周报" } < / button > < / form > { pilotWeeklyResult ? < div className = "acceptance-result" > < div className = "section-heading" > < div > < h4 > 最 近 生 成 : { pilotWeeklyResult . week_start } 起 始 周 < / h4 > < p > { pilotWeeklyResult . timezone } · { formatTimestamp ( pilotWeeklyResult . generated_at ) } · 周 报 { pilotWeeklyResult . id } < / p > < / div > < span className = { ` status ${ pilotWeeklyResult . is_complete ? "active" : "warning" } ` } > { pilotWeeklyResult . is_complete ? "完整自然周" : "周中快照" } < / span > < / div > < div className = "issue-summary-grid" > < article > < span > 人 工 修 订 率 < / span > < strong > { basisPointsLabel ( pilotWeeklyResult . content_review . manual_revision_rate_available , pilotWeeklyResult . content_review . manual_revision_rate_basis_points ) } < / strong > < small > { pilotWeeklyResult . content_review . stories_manually_revised } / { pilotWeeklyResult . content_review . stories_review_touched } 个 审 核 故 事 < / small > < / article > < article > < span > 故 事 确 认 率 < / span > < strong > { basisPointsLabel ( pilotWeeklyResult . content_review . story_confirmation_rate_available , pilotWeeklyResult . content_review . story_confirmation_rate_basis_points ) } < / strong > < small > 确 认 { pilotWeeklyResult . content_review . stories_confirmed } · 拒 绝 { pilotWeeklyResult . content_review . stories_rejected } < / small > < / article > < article > < span > 隐 私 请 求 < / span > < strong > { pilotWeeklyResult . privacy . requests_created_during_week } < / strong > < small > 当 前 未 完 成 { pilotWeeklyResult . privacy . current_open } < / small > < / article > < article className = { pilotWeeklyResult . config . drifted + pilotWeeklyResult . config . unreported ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 配 置 差 异 < / span > < strong > { pilotWeeklyResult . config . drifted + pilotWeeklyResult . config . unreported } < / strong > < small > 一 致 { pilotWeeklyResult . config . aligned } / { pilotWeeklyResult . config . eligible_devices } < / small > < / article > < / div > < div className = "diagnostic-results" > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 记 忆 确 认 与 索 引 < / strong > < span > 首 版 { pilotWeeklyResult . content_review . memories_created } · 修 订 { pilotWeeklyResult . content_review . memory_revisions } < / span > < / div > < / div > < p > 当 前 索 引 待 处 理 { pilotWeeklyResult . content_review . current_memory_index_pending } , 失 败 { pilotWeeklyResult . content_review . current_memory_index_failed } 。 < / p > < / article > < article className = "diagnostic-card" > < div className = "diagnostic-card__head" > < div > < strong > 固 件 分 布 < / strong > < span > { pilotWeeklyResult . firmware_versions . reduce ( ( sum , item ) = > sum + item . device_count , 0 ) } 台 可 用 设 备 < / span > < / div > < / div > < p > { pilotWeeklyResult . firmware_versions . length ? pilotWeeklyResult . firmware_versions . map ( ( item ) = > ` ${ item . model } / ${ item . firmware_version } : ${ item . device_count } 台 ` ) . join ( "; " ) : "当前没有可用且已绑定设备。" } < / p > < / article > < / div > { pilotWeeklyResult . external_evidence . map ( ( item ) = > < p className = "recording-notice recording-notice--error" key = { item . code } > < strong > 外 部 证 据 仍 需 补 充 : 投 诉 < / strong > < br / > { item . reason } < / p > ) } < p className = "empty-copy" > { pilotWeeklyResult . disclaimer } < / p > < / div > : null } < / section > : null }
< section className = "diagnostic-jobs platform-health" > < div className = "section-heading" > < div > < p className = "eyebrow" > SERVER HEALTH < / p > < h3 > 云 端 主 机 运 行 状 态 < / h3 > < p > 主 机 每 五 分 钟 签 名 上 报 公 网 入 口 、 容 器 、 备 份 、 证 书 、 磁 盘 和 定 时 任 务 的 脱 敏 结 果 。 < / p > < / div > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > void loadPlatformHealth ( ) } > 刷 新 状 态 < / button > < / div > { platformHealth ? ( ( ) = > { const state = platformHealthState ( platformHealth ) ; const critical = platformHealth . checks . filter ( ( item ) = > item . status === "critical" ) . length ; const warning = platformHealth . checks . filter ( ( item ) = > item . status === "warning" ) . length ; return < > < div className = "issue-summary-grid" > < article className = { state . tone === "active" ? "issue-gate-pass" : "issue-gate-blocked" } > < span > 综 合 状 态 < / span > < strong > { state . label } < / strong > < small > 上 报 { formatTimestamp ( platformHealth . observed_at ) } < / small > < / article > < article > < span > 检 查 项 < / span > < strong > { platformHealth . checks . length } < / strong > < small > 全 部 脱 敏 < / small > < / article > < article className = { critical ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 严 重 异 常 < / span > < strong > { critical } < / strong > < small > 需 要 立 即 处 置 < / small > < / article > < article className = { warning ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 预 警 < / span > < strong > { warning } < / strong > < small > 需 要 持 续 观 察 < / small > < / article > < / div > < div className = "external-dependency-grid" > { platformHealth . checks . map ( ( item ) = > < article className = "diagnostic-card" key = { item . name } > < div className = "diagnostic-card__head" > < div > < strong > { platformHealthCheckLabel ( item . name ) } < / strong > < span > { item . name } < / span > < / div > < span className = { ` status ${ item . status === "healthy" ? "active" : item . status === "warning" ? "warning" : "danger" } ` } > { platformHealthCheckStatusLabel ( item . status ) } < / span > < / div > < p > { platformHealthValueLabel ( item . name , item . value ) } < / p > < / article > ) } < / div > { state . stale ? < p className = "recording-notice recording-notice--error" > 最 近 上 报 已 超 过 15 分 钟 , 不 能 继 续 视 为 当 前 状 态 ; 请 检 查 健 康 监 测 定 时 器 、 回 调 进 程 和 签 名 配 置 。 < / p > : null } < / > } ) ( ) : < p className = "empty-copy" > 尚 未 收 到 主 机 健 康 快 照 ; 完 成 监 测 回 调 配 置 后 , 首 个 五 分 钟 周 期 会 自 动 出 现 。 < / p > } < / section >
< section className = "diagnostic-jobs platform-health" > < div className = "section-heading" > < div > < p className = "eyebrow" > SERVER HEALTH < / p > < h3 > 云 端 主 机 运 行 状 态 < / h3 > < p > 主 机 每 五 分 钟 签 名 上 报 公 网 入 口 、 监 听 端 口 、 容 器 、 备 份 、 证 书 、 磁 盘 和 定 时 任 务 的 脱 敏 结 果 。 < / p > < / div > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > void loadPlatformHealth ( ) } > 刷 新 状 态 < / button > < / div > { platformHealth ? ( ( ) = > { const state = platformHealthState ( platformHealth ) ; const critical = platformHealth . checks . filter ( ( item ) = > item . status === "critical" ) . length ; const warning = platformHealth . checks . filter ( ( item ) = > item . status === "warning" ) . length ; return < > < div className = "issue-summary-grid" > < article className = { state . tone === "active" ? "issue-gate-pass" : "issue-gate-blocked" } > < span > 综 合 状 态 < / span > < strong > { state . label } < / strong > < small > 上 报 { formatTimestamp ( platformHealth . observed_at ) } < / small > < / article > < article > < span > 检 查 项 < / span > < strong > { platformHealth . checks . length } < / strong > < small > 全 部 脱 敏 < / small > < / article > < article className = { critical ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 严 重 异 常 < / span > < strong > { critical } < / strong > < small > 需 要 立 即 处 置 < / small > < / article > < article className = { warning ? "issue-gate-blocked" : "issue-gate-pass" } > < span > 预 警 < / span > < strong > { warning } < / strong > < small > 需 要 持 续 观 察 < / small > < / article > < / div > < div className = "external-dependency-grid" > { platformHealth . checks . map ( ( item ) = > < article className = "diagnostic-card" key = { item . name } > < div className = "diagnostic-card__head" > < div > < strong > { platformHealthCheckLabel ( item . name ) } < / strong > < span > { item . name } < / span > < / div > < span className = { ` status ${ item . status === "healthy" ? "active" : item . status === "warning" ? "warning" : "danger" } ` } > { platformHealthCheckStatusLabel ( item . status ) } < / span > < / div > < p > { platformHealthValueLabel ( item . name , item . value ) } < / p > < / article > ) } < / div > { state . stale ? < p className = "recording-notice recording-notice--error" > 最 近 上 报 已 超 过 15 分 钟 , 不 能 继 续 视 为 当 前 状 态 ; 请 检 查 健 康 监 测 定 时 器 、 回 调 进 程 和 签 名 配 置 。 < / p > : null } < / > } ) ( ) : < p className = "empty-copy" > 尚 未 收 到 主 机 健 康 快 照 ; 完 成 监 测 回 调 配 置 后 , 首 个 五 分 钟 周 期 会 自 动 出 现 。 < / p > } < / section >
< section className = "diagnostic-jobs external-dependencies" > < div className = "section-heading" > < div > < p className = "eyebrow" > EXTERNAL PREFLIGHT < / p > < h3 > 外 部 依 赖 预 检 < / h3 > < p > API与Worker周期执行不消耗模型或语音额度的连通性检查 , 仅 保 存 脱 敏 结 果 。 < / p > < / div > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > void loadExternalDependencies ( ) } > 刷 新 状 态 < / button > < / div > { externalDependencies . length ? < div className = "external-dependency-grid" > { externalDependencies . map ( ( item ) = > { const state = externalDependencyState ( item ) ; return < article className = "diagnostic-card" key = { ` ${ item . service_name } - ${ item . dependency } ` } > < div className = "diagnostic-card__head" > < div > < strong > { externalDependencyLabel ( item . dependency ) } < / strong > < span > { serviceLabel ( item . service_name ) } · 最 近 检 查 { formatTimestamp ( item . checked_at ) } < / span > < / div > < span className = { ` status ${ state . tone } ` } > { state . label } < / span > < / div > < dl > < div > < dt > 探 针 耗 时 < / dt > < dd > { item . latency_ms } 毫 秒 < / dd > < / div > < div > < dt > 连 续 失 败 < / dt > < dd > { item . consecutive_failures } 次 < / dd > < / div > < div > < dt > 最 近 成 功 < / dt > < dd > { formatTimestamp ( item . last_success_at ) } < / dd > < / div > < div > < dt > 最 近 失 败 < / dt > < dd > { formatTimestamp ( item . last_failure_at ) } < / dd > < / div > < / dl > { state . stale ? < p > 该 进 程 已 超 过 三 倍 探 针 周 期 未 更 新 , 不 能 视 为 当 前 可 用 。 < / p > : item . last_error_code ? < p > 归 一 化 错 误 : < strong > { item . last_error_code } < / strong > < / p > : null } < / article > } ) } < / div > : < p className = "empty-copy" > 当 前 进 程 尚 未 写 入 外 部 探 针 结 果 ; 本 地 未 启 用 的 方 舟 或 RTC依赖不会伪装为已验收 。 < / p > } < / section >
< section className = "diagnostic-jobs external-dependencies" > < div className = "section-heading" > < div > < p className = "eyebrow" > EXTERNAL PREFLIGHT < / p > < h3 > 外 部 依 赖 预 检 < / h3 > < p > API与Worker周期执行不消耗模型或语音额度的连通性检查 , 仅 保 存 脱 敏 结 果 。 < / p > < / div > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > void loadExternalDependencies ( ) } > 刷 新 状 态 < / button > < / div > { externalDependencies . length ? < div className = "external-dependency-grid" > { externalDependencies . map ( ( item ) = > { const state = externalDependencyState ( item ) ; return < article className = "diagnostic-card" key = { ` ${ item . service_name } - ${ item . dependency } ` } > < div className = "diagnostic-card__head" > < div > < strong > { externalDependencyLabel ( item . dependency ) } < / strong > < span > { serviceLabel ( item . service_name ) } · 最 近 检 查 { formatTimestamp ( item . checked_at ) } < / span > < / div > < span className = { ` status ${ state . tone } ` } > { state . label } < / span > < / div > < dl > < div > < dt > 探 针 耗 时 < / dt > < dd > { item . latency_ms } 毫 秒 < / dd > < / div > < div > < dt > 连 续 失 败 < / dt > < dd > { item . consecutive_failures } 次 < / dd > < / div > < div > < dt > 最 近 成 功 < / dt > < dd > { formatTimestamp ( item . last_success_at ) } < / dd > < / div > < div > < dt > 最 近 失 败 < / dt > < dd > { formatTimestamp ( item . last_failure_at ) } < / dd > < / div > < / dl > { state . stale ? < p > 该 进 程 已 超 过 三 倍 探 针 周 期 未 更 新 , 不 能 视 为 当 前 可 用 。 < / p > : item . last_error_code ? < p > 归 一 化 错 误 : < strong > { item . last_error_code } < / strong > < / p > : null } < / article > } ) } < / div > : < p className = "empty-copy" > 当 前 进 程 尚 未 写 入 外 部 探 针 结 果 ; 本 地 未 启 用 的 方 舟 或 RTC依赖不会伪装为已验收 。 < / p > } < / section >
< form className = "diagnostic-search" onSubmit = { ( event ) = > void search ( event ) } > < label > 检 索 字 段 < select value = { field } onChange = { ( event ) = > setField ( event . target . value as typeof field ) } > { fields . map ( ( [ key , label ] ) = > < option value = { key } key = { key } > { label } < / option > ) } < / select > < / label > < label > 精 确 编 号 < input value = { value } onChange = { ( event ) = > setValue ( event . target . value ) } placeholder = "输入完整编号" / > < / label > < button type = "submit" disabled = { loading || ! value . trim ( ) } > { loading ? "查询中…" : "查询" } < / button > { canOperate ? < button type = "button" className = "button-secondary" disabled = { busy || ! value . trim ( ) } onClick = { openBundleExport } > 导 出 脱 敏 诊 断 包 < / button > : null } < / form >
< form className = "diagnostic-search" onSubmit = { ( event ) = > void search ( event ) } > < label > 检 索 字 段 < select value = { field } onChange = { ( event ) = > setField ( event . target . value as typeof field ) } > { fields . map ( ( [ key , label ] ) = > < option value = { key } key = { key } > { label } < / option > ) } < / select > < / label > < label > 精 确 编 号 < input value = { value } onChange = { ( event ) = > setValue ( event . target . value ) } placeholder = "输入完整编号" / > < / label > < button type = "submit" disabled = { loading || ! value . trim ( ) } > { loading ? "查询中…" : "查询" } < / button > { canOperate ? < button type = "button" className = "button-secondary" disabled = { busy || ! value . trim ( ) } onClick = { openBundleExport } > 导 出 脱 敏 诊 断 包 < / button > : null } < / form >
{ diagnosticBundleDraft ? < form className = "sensitive-access-request controlled-operation" aria-label = "脱敏诊断包导出" onSubmit = { ( event ) = > void exportBundle ( event ) } > < div className = "sensitive-access-request__head" > < div > < p className = "eyebrow" > REDACTED DIAGNOSTIC EXPORT < / p > < h3 > 导 出 脱 敏 诊 断 包 < / h3 > < / div > < span className = "status warning" > 导 出 行 为 写 入 审 计 < / span > < / div > < p > 本 次 导 出 固 定 使 用 “ < strong > { diagnosticFieldLabel ( diagnosticBundleDraft . field ) } < / strong > = < strong > { diagnosticBundleDraft . value } < / strong > ” 的 精 确 检 索 条 件 。 文 件 只 包 含 当 前 脱 敏 诊 断 快 照 , 不 包 含 字 幕 、 录 音 地 址 、 短 期 凭 证 或 密 钥 正 文 。 < / p > < label > < span > 导 出 原 因 < / span > < textarea autoFocus required maxLength = { 500 } value = { diagnosticBundleDraft . reason } onChange = { ( event ) = > setDiagnosticBundleDraft ( { . . . diagnosticBundleDraft , reason :event.target.value } ) } placeholder = "说明接收方、联调问题和使用范围;不要粘贴敏感正文" / > < / label > < div className = "sensitive-access-request__actions" > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > setDiagnosticBundleDraft ( undefined ) } > 取 消 < / button > < button type = "submit" disabled = { busy || ! diagnosticBundleDraft . reason . trim ( ) } > { busy ? "正在生成…" : "生成并下载" } < / button > < / div > < / form > : null }
{ diagnosticBundleDraft ? < form className = "sensitive-access-request controlled-operation" aria-label = "脱敏诊断包导出" onSubmit = { ( event ) = > void exportBundle ( event ) } > < div className = "sensitive-access-request__head" > < div > < p className = "eyebrow" > REDACTED DIAGNOSTIC EXPORT < / p > < h3 > 导 出 脱 敏 诊 断 包 < / h3 > < / div > < span className = "status warning" > 导 出 行 为 写 入 审 计 < / span > < / div > < p > 本 次 导 出 固 定 使 用 “ < strong > { diagnosticFieldLabel ( diagnosticBundleDraft . field ) } < / strong > = < strong > { diagnosticBundleDraft . value } < / strong > ” 的 精 确 检 索 条 件 。 文 件 只 包 含 当 前 脱 敏 诊 断 快 照 , 不 包 含 字 幕 、 录 音 地 址 、 短 期 凭 证 或 密 钥 正 文 。 < / p > < label > < span > 导 出 原 因 < / span > < textarea autoFocus required maxLength = { 500 } value = { diagnosticBundleDraft . reason } onChange = { ( event ) = > setDiagnosticBundleDraft ( { . . . diagnosticBundleDraft , reason :event.target.value } ) } placeholder = "说明接收方、联调问题和使用范围;不要粘贴敏感正文" / > < / label > < div className = "sensitive-access-request__actions" > < button type = "button" className = "button-secondary" disabled = { busy } onClick = { ( ) = > setDiagnosticBundleDraft ( undefined ) } > 取 消 < / button > < button type = "submit" disabled = { busy || ! diagnosticBundleDraft . reason . trim ( ) } > { busy ? "正在生成…" : "生成并下载" } < / button > < / div > < / form > : null }
@@ -149,8 +149,8 @@ function serviceLabel(value:OpsExternalDependency["service_name"]){return ({api:
function externalDependencyState(item:OpsExternalDependency){const stale=Date.now()-new Date(item.checked_at).getTime()>item.probe_interval_ms*3;return stale?{label:"结果过期",tone:"warning",stale:true}:item.status==="AVAILABLE"?{label:"可用",tone:"active",stale:false}:{label:"不可用",tone:"danger",stale:false}}
function externalDependencyState(item:OpsExternalDependency){const stale=Date.now()-new Date(item.checked_at).getTime()>item.probe_interval_ms*3;return stale?{label:"结果过期",tone:"warning",stale:true}:item.status==="AVAILABLE"?{label:"可用",tone:"active",stale:false}:{label:"不可用",tone:"danger",stale:false}}
function platformHealthState(item:PlatformHealthSnapshot){const stale=Date.now()-new Date(item.observed_at).getTime()>15*60*1000;if(stale)return{label:"上报过期",tone:"danger",stale:true};return item.status==="healthy"?{label:"运行正常",tone:"active",stale:false}:item.status==="warning"?{label:"存在预警",tone:"warning",stale:false}:{label:"严重异常",tone:"danger",stale:false}}
function platformHealthState(item:PlatformHealthSnapshot){const stale=Date.now()-new Date(item.observed_at).getTime()>15*60*1000;if(stale)return{label:"上报过期",tone:"danger",stale:true};return item.status==="healthy"?{label:"运行正常",tone:"active",stale:false}:item.status==="warning"?{label:"存在预警",tone:"warning",stale:false}:{label:"严重异常",tone:"danger",stale:false}}
function platformHealthCheckStatusLabel(value:PlatformHealthSnapshot["checks"][number]["status"]){return value==="healthy"?"正常":value==="warning"?"预警":"严重"}
function platformHealthCheckStatusLabel(value:PlatformHealthSnapshot["checks"][number]["status"]){return value==="healthy"?"正常":value==="warning"?"预警":"严重"}
function platformHealthCheckLabel(value:string){const labels:Record<string,string>={public_origin:"公网地址",public_https:"HTTPS入口",oidc_issuer:"身份签发地址",backup_freshness:"本地备份",offsite_backup:"异地备份",backup_service:"备份服务","platform-backup.timer":"备份定时器","platform-offsite-backup.timer":"异地备份定时器","certbot-ip-renew.timer":"证书续期定时器",certificate:"HTTPS证书",disk_usage:"磁盘空间",container_postgres:"PostgreSQL",container_redis:"Redis",container_minio:"对象存储",container_keycloak:"身份服务",container_api:"业务API",container_callbacks:"回调服务",container_worker:"后台任务",container_web:"前端页面",container_gateway:"HTTPS网关","container_mock-provider":"模拟语音提供器","container_mock-alert-receiver":"模拟告警接收器"};return labels[value]??value}
function platformHealthCheckLabel(value:string){const labels:Record<string,string>={public_origin:"公网地址",public_https:"HTTPS入口",public_tcp_listeners:"公网监听端口", oidc_issuer:"身份签发地址",backup_freshness:"本地备份",offsite_backup:"异地备份",backup_service:"备份服务","platform-backup.timer":"备份定时器","platform-offsite-backup.timer":"异地备份定时器","certbot-ip-renew.timer":"证书续期定时器",certificate:"HTTPS证书",disk_usage:"磁盘空间",container_postgres:"PostgreSQL",container_redis:"Redis",container_minio:"对象存储",container_keycloak:"身份服务",container_api:"业务API",container_callbacks:"回调服务",container_worker:"后台任务",container_web:"前端页面",container_gateway:"HTTPS网关","container_mock-provider":"模拟语音提供器","container_mock-alert-receiver":"模拟告警接收器"};return labels[value]??value}
function platformHealthValueLabel(_name:string,value:string){if(value==="not_required")return "当前未要求启用";if(value==="issuer_matches")return "签发地址一致";if(value==="http_200")return "公网访问成功";if(value==="enabled/active")return "已启用并运行";if(value==="success")return "最近执行成功";if(value.startsWith("age_seconds=")){const seconds=Number(value.slice(12));return Number.isFinite(seconds)? ` 距最近成功 $ { formatDuration ( seconds * 1000 ) } ` :value}if(value.startsWith("remaining_seconds=")){const seconds=Number(value.slice(18));return Number.isFinite(seconds)? ` 剩余 $ { Math.floor ( seconds / 86400 ) } 天 ` : value}if(value.startsWith("used_percent="))return ` 已使用 $ { value.slice ( 13 ) } % ` ;if(value==="running/healthy"||value==="running/none")return "容器正在运行";return value}
function platformHealthValueLabel(_name:string,value:string){if(value==="not_required")return "当前未要求启用";if(value==="issuer_matches")return "签发地址一致";if(value==="http_200")return "公网访问成功";if(value==="enabled/active")return "已启用并运行";if(value==="success")return "最近执行成功";if(value.startsWith("ports="))return ` 当前对外端口 $ { value.slice ( 6 ) } ` ;if(value.startsWith("unexpected_ports="))return ` 发现未授权端口 $ { value.slice ( 17 ) } ` ;if(value.startsWith(" age_seconds=")){const seconds=Number(value.slice(12));return Number.isFinite(seconds)?` 距最近成功 $ { formatDuration ( seconds * 1000 ) } ` :value}if(value.startsWith("remaining_seconds=")){const seconds=Number(value.slice(18));return Number.isFinite(seconds)? ` 剩余 $ { Math.floor ( seconds / 86400 ) } 天 ` : value}if(value.startsWith("used_percent="))return ` 已使用 $ { value.slice ( 13 ) } % ` ;if(value==="running/healthy"||value==="running/none")return "容器正在运行";return value}
function downloadJSON(value:unknown,filename:string){const blob=new Blob([JSON.stringify(value,null,2)],{type:"application/json"});const url=URL.createObjectURL(blob);const anchor=document.createElement("a");anchor.href=url;anchor.download=filename;anchor.click();URL.revokeObjectURL(url)}
function downloadJSON(value:unknown,filename:string){const blob=new Blob([JSON.stringify(value,null,2)],{type:"application/json"});const url=URL.createObjectURL(blob);const anchor=document.createElement("a");anchor.href=url;anchor.download=filename;anchor.click();URL.revokeObjectURL(url)}
function acceptanceGateLabel(value:OpsAcceptanceSnapshot["gates"][number]["code"]){return ({candidate_build_identified:"候选构建",database_migration_clean:"数据库迁移",required_dependencies_available:"必需外部依赖",integration_issues_clear:"高严重度问题",outbox_clear:"可靠任务",critical_alerts_clear:"高严重度告警",platform_health_current:"云端主机健康"} as Record<OpsAcceptanceSnapshot["gates"][number]["code"],string>)[value]}
function acceptanceGateLabel(value:OpsAcceptanceSnapshot["gates"][number]["code"]){return ({candidate_build_identified:"候选构建",database_migration_clean:"数据库迁移",required_dependencies_available:"必需外部依赖",integration_issues_clear:"高严重度问题",outbox_clear:"可靠任务",critical_alerts_clear:"高严重度告警",platform_health_current:"云端主机健康"} as Record<OpsAcceptanceSnapshot["gates"][number]["code"],string>)[value]}
function acceptanceResourceStateLabel(value:OpsAcceptanceSnapshot["alerts"]["blocking_items"][number]["resource_state"]){return ({PRESENT:"资源存在",MISSING:"资源已不存在,仍需人工复核关闭",AGGREGATE:"聚合队列",UNKNOWN:"未提供自动核对规则"} as Record<OpsAcceptanceSnapshot["alerts"]["blocking_items"][number]["resource_state"],string>)[value]}
function acceptanceResourceStateLabel(value:OpsAcceptanceSnapshot["alerts"]["blocking_items"][number]["resource_state"]){return ({PRESENT:"资源存在",MISSING:"资源已不存在,仍需人工复核关闭",AGGREGATE:"聚合队列",UNKNOWN:"未提供自动核对规则"} as Record<OpsAcceptanceSnapshot["alerts"]["blocking_items"][number]["resource_state"],string>)[value]}