(busy, label)
| 7774 | const [cls, label] = _CDP_VERDICT_STYLE[d.verdict] || _CDP_VERDICT_STYLE.unknown; |
| 7775 | let html = `<div class="mb-2 px-3 py-2 rounded border ${cls} text-sm">${label}</div>`; |
| 7776 | html += `<p class="text-xs text-gray-500 mb-2">Interface: ${escapeHtml(d.interface || '—')} · ${d.seconds}s · ${d.packet_count} CDP frame(s), ${d.speaker_count} speaker(s)${d.learned ? ' · <span class="text-gray-400">baseline learned now</span>' : ''}</p>`; |
| 7777 | if ((d.speakers || []).length) { |
| 7778 | html += '<table class="min-w-full text-xs text-gray-300 whitespace-nowrap"><thead>' + |
| 7779 | '<tr class="text-left text-gray-500"><th class="px-2 py-1">Device-ID</th><th class="px-2 py-1">Platform</th><th class="px-2 py-1">IOS / version</th><th class="px-2 py-1">Mgmt IP</th><th class="px-2 py-1">Native VLAN</th><th class="px-2 py-1">Voice VLAN</th><th class="px-2 py-1">Port</th><th class="px-2 py-1">Trust</th></tr>' + |
| 7780 | '</thead><tbody>' + |
| 7781 | d.speakers.map(sp => { |
| 7782 | const badge = sp.baseline ? '<span class="text-green-400">✓ known</span>' : '<span class="text-red-300">? new</span>'; |
| 7783 | return `<tr class="border-t border-slate-800"> |
| 7784 | <td class="px-2 py-1 font-mono ${sp.baseline ? 'text-gray-200' : 'text-red-300'}">${escapeHtml(sp.device_id || sp.src)}</td> |
| 7785 | <td class="px-2 py-1 text-gray-400">${escapeHtml(sp.platform || '—')}</td> |
| 7786 | <td class="px-2 py-1 text-gray-400" title="${escapeHtml(sp.sw_version || '')}">${escapeHtml((sp.sw_version || '—').slice(0, 46))}</td> |
| 7787 | <td class="px-2 py-1 font-mono text-amber-300/90">${escapeHtml(sp.mgmt_addr || '—')}</td> |
| 7788 | <td class="px-2 py-1 text-amber-300/90">${sp.native_vlan == null ? '—' : sp.native_vlan}</td> |
no test coverage detected