From 61a1384bb69b6995a93b8ead712357a36540fd7f Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 1 Jul 2026 00:49:49 +0000 Subject: [PATCH] fix: hide internal sentinel check ids in monitor --- .../monitor-web.js | 34 +++++++++++++++++-- scripts/src/hwlab-node-web-sentinel-p5.ts | 2 +- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js b/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js index 0a8569a0..092cfe06 100644 --- a/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js +++ b/scripts/assets/web-probe-sentinel-monitor-web/monitor-web.js @@ -95,6 +95,31 @@ const checkDisplayCatalog = { title: "业务轮次未完成", summary: "巡检未确认到稳定的业务交互结果,不能作为恢复证据。", }, + "frontend-browser-memory-rss-red": { + code: "CHECK-801", + title: "页面内存超出预算", + summary: "页面有效内存超过配置红线,已按阻塞错误展示。", + }, + "frontend-browser-memory-growth-red": { + code: "CHECK-802", + title: "页面内存持续增长", + summary: "页面有效内存在观察窗口内持续增长并超过配置预算,符合卡死风险特征。", + }, + "frontend-browser-freeze-runner-blocker": { + code: "CHECK-803", + title: "浏览器冻结已阻塞", + summary: "浏览器冻结策略已触发,巡检中止页面并报红,不能用刷新或兜底掩盖。", + }, + "frontend-playwright-responsiveness-red": { + code: "CHECK-804", + title: "页面响应探测超时", + summary: "页面响应探测超过配置预算,已按前端卡死处理并报红。", + }, + "frontend-cdp-metrics-timeout-red": { + code: "CHECK-805", + title: "浏览器指标采集超时", + summary: "浏览器侧指标连续采集超时,说明页面运行时可能已经无响应。", + }, }; createApp({ @@ -1230,7 +1255,7 @@ function checkDisplay(item) { const rawCode = rawCheckCode(item); const rawId = rawFindingId(item); const registered = checkDisplayCatalog[rawId] || checkDisplayCatalog[rawCode]; - const serviceCode = displayCheckCode(item?.checkCode || item?.check?.code); + const serviceCode = publicCheckCode(item?.checkCode || item?.check?.code); if (registered) { return { ...registered, @@ -1240,7 +1265,7 @@ function checkDisplay(item) { }; } return { - code: serviceCode || displayCheckCode(rawId || rawCode) || stableCheckCode(rawCode), + code: serviceCode || publicCheckCode(rawId || rawCode) || stableCheckCode(rawCode || rawId), title: safeUserText(item?.checkTitleZh || item?.check?.titleZh) || "未登记监测项", summary: safeUserText(item?.checkSummaryZh || item?.summary || item?.evidenceSummary) || "已记录监测项详情,见报告原文。", }; @@ -1261,6 +1286,11 @@ function displayCheckCode(value) { return text; } +function publicCheckCode(value) { + const text = displayCheckCode(value); + return /^(?:CHECK|WBC)-\d+$/u.test(text) ? text : ""; +} + function stableCheckCode(value) { const text = String(value || "unknown"); let hash = 0; diff --git a/scripts/src/hwlab-node-web-sentinel-p5.ts b/scripts/src/hwlab-node-web-sentinel-p5.ts index f515f835..53a9f7e6 100644 --- a/scripts/src/hwlab-node-web-sentinel-p5.ts +++ b/scripts/src/hwlab-node-web-sentinel-p5.ts @@ -674,7 +674,7 @@ const dom = await page.evaluate(async ({ expectedRoutePrefix, expectedSentinelId const runListText = text(".run-list"); const timingVisibility = { latestRunMinutes: latestRunCounts.durationMinutes, - detailHasDuration: /运行分钟\s+[\d.]+\s*分钟/u.test(detailText), + detailHasDuration: /运行分钟\s*[\d.]+\s*分钟/u.test(detailText), listHasDuration: /运行\s+[\d.]+\s*分钟/u.test(runListText), tooltipHasDuration: trendTooltipSummary.hasDuration, };