feat: 分离 Alpha 检查与提交限制,优化检查统计与前端展示

This commit is contained in:
yuxuanhui
2026-09-12 22:11:11 +08:00
parent 5eb6008ef7
commit 45eb4c3a17
13 changed files with 300 additions and 21 deletions
+43 -7
View File
@@ -474,16 +474,46 @@ function MetricTable({
}
/** IS and OS checks are separate observations; missing values never imply a pass. */
function PlatformChecks({ title, checks }: { title: string; checks: unknown }) {
function PlatformChecks({
title,
checks,
submissionLimit = false,
}: {
title: string;
checks: unknown;
submissionLimit?: boolean;
}) {
const rows = Array.isArray(checks)
? checks.filter(
(item): item is Record<string, unknown> =>
item !== null && typeof item === "object" && !Array.isArray(item),
)
: [];
const limits = rows.filter((check) => check.name === "REGULAR_SUBMISSION");
const alphaChecks = rows.filter(
(check) => check.name !== "REGULAR_SUBMISSION",
);
if (!submissionLimit && limits.length) {
return (
<>
<PlatformChecks title={title} checks={alphaChecks} />
<PlatformChecks
title={`${title} · 提交限制`}
checks={limits}
submissionLimit
/>
</>
);
}
return (
<section aria-label={title}>
<h4>{title}</h4>
{submissionLimit && (
<p className="muted">
以下为缓存观测时的提交限制,不计入 Alpha
失败项;当前额度需重新检查确认。
</p>
)}
{rows.length ? (
rows.map((check, i) => (
<div className="check-row" key={i}>
@@ -496,17 +526,23 @@ function PlatformChecks({ title, checks }: { title: string; checks: unknown }) {
check.result === "PASS"
? "green"
: check.result === "FAIL"
? "red"
? submissionLimit
? "orange"
: "red"
: check.result === "WARNING"
? "orange"
: "grey"
}
>
{check.result === "WARNING"
? "警告(WARNING)"
: check.result === "PENDING"
? "待定(PENDING)"
: displayValue(check.result)}
{submissionLimit && check.result === "FAIL"
? "提交受限(FAIL)"
: submissionLimit && check.result === "PASS"
? "当时未受限(PASS)"
: check.result === "WARNING"
? "警告(WARNING)"
: check.result === "PENDING"
? "待定(PENDING)"
: displayValue(check.result)}
</Tag>
</div>
))