流水线
—发布报告
JSON产物与哈希
—| 文件 | 大小 | SHA-256 |
|---|
import type { Check, Snapshot } from "../shared/ipc"; import type { Artifact, StepResult } from "../shared/pipeline"; function escapeHtml(text: string): string { return text.replace(/[&<>"]/g, (char) => { if (char === "&") return "&"; if (char === "<") return "<"; if (char === ">") return ">"; return """; }); } function time(at: number): string { return new Date(at).toLocaleTimeString("zh-CN", { hour12: false }); } function bytes(value: number): string { return value < 1024 ? `${value} B` : `${(value / 1024).toFixed(1)} KB`; } function statusTag(status: StepResult["status"]): string { if (status === "pass") return 'PASS'; if (status === "fail") return 'FAIL'; if (status === "running") return 'RUN'; return 'PENDING'; } function stepRow(step: StepResult, index: number): string { return `
${escapeHtml(step.log || "等待执行")}
${escapeHtml(row.name)}${escapeHtml(row.sha256.slice(0, 16))}…${escapeHtml(check.detail)}
| 文件 | 大小 | SHA-256 |
|---|
${escapeHtml(state.reportPath)}