fix: surface sentinel timing detail in reports
This commit is contained in:
@@ -1110,6 +1110,8 @@ function findingSearchText(item) {
|
||||
item?.rootCause,
|
||||
item?.evidenceSummary,
|
||||
item?.nextAction,
|
||||
item?.timingStatus,
|
||||
item?.timingSourceOfTruth,
|
||||
item?.scenarioId,
|
||||
item?.latestRunId,
|
||||
].filter((value) => value !== null && value !== undefined).join(" ").toLowerCase();
|
||||
@@ -1146,6 +1148,7 @@ function checkDetailRows(item) {
|
||||
{ key: "time", label: "时间", value: checkTimeText(item) },
|
||||
{ key: "scenario", label: "场景", value: safeDetailValue(item?.scenarioId || item?.scenario_id) },
|
||||
{ key: "observer", label: "观察任务", value: safeDetailValue(item?.observerId || item?.observer_id) },
|
||||
{ key: "timing", label: "计时来源", value: checkTimingText(item) },
|
||||
{ key: "report", label: "报告", value: shortHash(item?.reportJsonSha256 || item?.report_json_sha256 || item?.reportSha256 || "") || "-" },
|
||||
].filter((row) => row.value !== "");
|
||||
}
|
||||
@@ -1159,11 +1162,23 @@ function checkEvidenceRows(item) {
|
||||
{ key: "page", label: "页面", value: safeDetailValue(item?.pageRole || evidence.pageRole) },
|
||||
{ key: "command", label: "命令编号", value: safeDetailValue(item?.commandId || evidence.commandId) },
|
||||
{ key: "range", label: "采集范围", value: safeDetailValue(item?.sentinelRange || evidence.sentinelRange) },
|
||||
{ key: "timing", label: "计时状态", value: checkTimingText(item) },
|
||||
{ key: "blocking", label: "阻塞状态", value: item?.blocking === true ? "阻塞" : "非阻塞" },
|
||||
].filter((row) => row.value !== "" && row.value !== "-");
|
||||
return rows.length > 0 ? rows : [{ key: "none", label: "证据摘要", value: "已记录到报告详情。" }];
|
||||
}
|
||||
|
||||
function checkTimingText(item) {
|
||||
const status = item?.timingStatus || "";
|
||||
const source = item?.timingSourceOfTruth || item?.expectedElapsedSource || item?.evidenceKind || "";
|
||||
if (!status && !source) return "";
|
||||
return [
|
||||
status ? `status=${safeDetailValue(status)}` : "",
|
||||
source ? `source=${safeDetailValue(source)}` : "",
|
||||
item?.timingAlert === true ? "alert=true" : "",
|
||||
].filter(Boolean).join(" ");
|
||||
}
|
||||
|
||||
function safeDetailValue(value) {
|
||||
if (value === null || value === undefined || value === "") return "-";
|
||||
const text = String(value).replace(/\s+/g, " ").trim();
|
||||
|
||||
Reference in New Issue
Block a user