(path)
| 6480 | function _wtSevChip(sev, n) { |
| 6481 | const [cls, icon] = _WT_SEV_STYLE[sev] || _WT_SEV_STYLE.info; |
| 6482 | return `<span class="px-2.5 py-1 rounded border ${cls}">${icon} ${escapeHtml(sev)}: ${n}</span>`; |
| 6483 | } |
| 6484 | // Correlated attack-chain incidents — the fused view. Rendered above the raw |
| 6485 | // alert list because an incident is the "so what" behind a cluster of alerts. |
| 6486 | function renderIncidents(incidents, elId, max) { |
| 6487 | const el = document.getElementById(elId); |
| 6488 | if (!el) return; |
| 6489 | const list = (incidents || []).slice(0, max || 4); |
| 6490 | if (!list.length) { el.innerHTML = ''; return; } |
| 6491 | el.innerHTML = list.map(inc => { |
| 6492 | const [cls] = _WT_SEV_STYLE[inc.severity] || _WT_SEV_STYLE.info; |
| 6493 | const ents = Object.entries(inc.entities || {}) |
| 6494 | .map(([k, v]) => escapeHtml(v.slice(0, 3).join(', '))).filter(Boolean).join(' · '); |
| 6495 | const conf = inc.confidence != null ? inc.confidence + '%' : ''; |
| 6496 | return `<div class="rounded-lg border ${cls} px-3 py-2"> |
| 6497 | <div class="flex items-start justify-between gap-3"> |
no test coverage detected