feat: 增加仅检查 MCP 工具并完善已提交 Alpha 指标展示
Deploy production / deploy (push) Successful in 57s

This commit is contained in:
yuxuanhui
2026-09-11 13:14:27 +08:00
parent f25161d624
commit 7e990b9a69
12 changed files with 311 additions and 63 deletions
+49 -23
View File
@@ -274,29 +274,11 @@ export function AlphaDetail({
<p className="muted">
展示已同步结果,查看此页不会触发新的平台检查。
</p>
{detail.checks.length ? (
detail.checks.map((check, i) => (
<div className="check-row" key={i}>
<span>{displayValue(check.name)}</span>
<span>
{displayValue(check.value)} / {displayValue(check.limit)}
</span>
<Tag
color={
check.result === "PASS"
? "green"
: check.result === "FAIL"
? "red"
: "grey"
}
>
{displayValue(check.result)}
</Tag>
</div>
))
) : (
<Empty description="平台尚未返回检查结果" />
)}
<PlatformChecks title="IS 检查结果" checks={detail.checks} />
<PlatformChecks
title="OS 检查结果"
checks={detail.os_metrics.checks}
/>
<Divider />
<div className="section-toolbar">
<div>
@@ -490,3 +472,47 @@ function MetricTable({
</div>
);
}
/** IS and OS checks are separate observations; missing values never imply a pass. */
function PlatformChecks({ title, checks }: { title: string; checks: unknown }) {
const rows = Array.isArray(checks)
? checks.filter(
(item): item is Record<string, unknown> =>
item !== null && typeof item === "object" && !Array.isArray(item),
)
: [];
return (
<section aria-label={title}>
<h4>{title}</h4>
{rows.length ? (
rows.map((check, i) => (
<div className="check-row" key={i}>
<span>{displayValue(check.name)}</span>
<span>
{displayValue(check.value)} / {displayValue(check.limit)}
</span>
<Tag
color={
check.result === "PASS"
? "green"
: check.result === "FAIL"
? "red"
: check.result === "WARNING"
? "orange"
: "grey"
}
>
{check.result === "WARNING"
? "警告(WARNING)"
: check.result === "PENDING"
? "待定(PENDING)"
: displayValue(check.result)}
</Tag>
</div>
))
) : (
<Empty description="平台尚未返回检查结果" />
)}
</section>
);
}