()
| 7484 | } |
| 7485 | const lvl = { warn: 'text-amber-300', info: 'text-gray-400', ok: 'text-green-400' }; |
| 7486 | const icon = { warn: '⚠', info: 'ℹ', ok: '✓' }; |
| 7487 | const findings = (d.findings || []).map(f => |
| 7488 | `<li class="${lvl[f.level] || ''}">${icon[f.level] || ''} ${escapeHtml(f.text)}</li>`).join(''); |
| 7489 | const protos = Object.keys(d.protocols || {}).length |
| 7490 | ? Object.entries(d.protocols).map(([k, v]) => |
| 7491 | `<span class="px-2 py-0.5 rounded bg-slate-800 text-xs mr-1">${escapeHtml(k)} ${v}</span>`).join('') |
| 7492 | : '<span class="text-gray-500">none</span>'; |
| 7493 | const detail = []; |
| 7494 | if (d.stp_roots && d.stp_roots.length) detail.push('STP root(s): ' + d.stp_roots.map(escapeHtml).join(', ') + (d.tcn ? ' · ' + d.tcn + ' TCN' : '')); |
| 7495 | if (d.dhcp_servers && d.dhcp_servers.length) detail.push('DHCP server(s): ' + d.dhcp_servers.map(escapeHtml).join(', ')); |
| 7496 | if (d.ra_sources && d.ra_sources.length) detail.push('IPv6 RA source(s): ' + d.ra_sources.map(escapeHtml).join(', ')); |
| 7497 | if (d.duplicate_ips && Object.keys(d.duplicate_ips).length) detail.push('Duplicate IPs: ' + Object.keys(d.duplicate_ips).map(escapeHtml).join(', ')); |
| 7498 | out.innerHTML = `<ul class="space-y-1 mb-2">${findings}</ul> |
| 7499 | <p class="text-xs text-gray-500 mb-1">${d.packets} pkts in ${d.seconds}s on ${escapeHtml(d.interface || '—')} · ${d.broadcast} bcast / ${d.multicast} mcast (${d.bcast_mcast_per_s}/s)</p> |
no test coverage detected