feat: show runtime diagnostics in management summary
This commit is contained in:
@@ -484,10 +484,18 @@ function renderMetrics() {
|
||||
const cards = [
|
||||
["事件总数", metrics.event_count ?? 0],
|
||||
["违规事件", metrics.violation_count ?? 0],
|
||||
["诊断帧数", metrics.diagnostics_count ?? 0],
|
||||
["基线状态", metrics.baseline_ready ? "ready" : "learning"],
|
||||
["最新报警", metrics.latest_alert_time || "-"],
|
||||
["事件文件", metrics.events_path || "-"],
|
||||
];
|
||||
els.metrics.innerHTML = cards.map(([label, value]) => `<div class="metric"><span>${label}</span><strong>${value}</strong></div>`).join("");
|
||||
const zoneCounts = metrics.latest_zone_counts || {};
|
||||
const zoneSummary = Object.keys(zoneCounts).length
|
||||
? `<div class="metric wide"><span>最新区域状态</span><strong>${Object.entries(zoneCounts)
|
||||
.map(([zoneId, count]) => `${zoneId}:${count}`)
|
||||
.join(" ")}</strong></div>`
|
||||
: "";
|
||||
els.metrics.innerHTML = cards.map(([label, value]) => `<div class="metric"><span>${label}</span><strong>${value}</strong></div>`).join("") + zoneSummary;
|
||||
}
|
||||
|
||||
function renderEvents() {
|
||||
|
||||
@@ -226,6 +226,10 @@ canvas {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.metric.wide {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.events-table {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user