()
| 7949 | if (d && d.missing_tool) extra = ' <button onclick="installNetTool(\'tcpdump\', this, runIsisWatch)" class="ml-2 underline text-cyan-400">Install tcpdump</button>'; |
| 7950 | out.innerHTML = '<p class="text-sm text-red-400">Error: ' + escapeHtml(msg) + extra + '</p>'; |
| 7951 | return; |
| 7952 | } |
| 7953 | const [cls, label] = _ISIS_VERDICT_STYLE[d.verdict] || _ISIS_VERDICT_STYLE.unknown; |
| 7954 | let html = `<div class="mb-2 px-3 py-2 rounded border ${cls} text-sm">${label}</div>`; |
| 7955 | html += `<p class="text-xs text-gray-500 mb-2">Interface: ${escapeHtml(d.interface || '—')} · ${d.seconds}s · ${d.packet_count} IS-IS PDUs, ${d.router_count} router(s), ${d.prefix_count} prefix(es) @ ${d.rate}/s${d.learned ? ' · <span class="text-gray-400">baseline learned now</span>' : ''}</p>`; |
| 7956 | if ((d.routers || []).length) { |
| 7957 | html += '<p class="text-xs uppercase text-gray-400 mt-2 mb-1">IS-IS routers (' + d.routers.length + ')</p>' + |
| 7958 | '<table class="min-w-full text-xs text-gray-300 whitespace-nowrap"><thead>' + |
| 7959 | '<tr class="text-left text-gray-500"><th class="px-2 py-1">Router</th><th class="px-2 py-1">Area</th><th class="px-2 py-1">Level</th><th class="px-2 py-1">Auth</th><th class="px-2 py-1">Status</th></tr>' + |
| 7960 | '</thead><tbody>' + |
| 7961 | d.routers.map(r => { |
| 7962 | const badge = r.baseline ? '<span class="text-green-400">✓ known</span>' : '<span class="text-amber-300">? new</span>'; |
| 7963 | const weak = (r.auth === 'none/cleartext' || r.auth === 'cleartext' || r.auth === 'none'); |
| 7964 | const auth = weak ? `<span class="text-amber-300">${escapeHtml(r.auth)}</span>` : `<span class="text-green-400">${escapeHtml(r.auth)}</span>`; |
| 7965 | const name = r.hostname ? `<span class="text-gray-200">${escapeHtml(r.hostname)}</span> <span class="text-gray-500">${escapeHtml(r.system_id)}</span>` : `<span class="font-mono">${escapeHtml(r.system_id)}</span>`; |
| 7966 | return `<tr class="border-t border-slate-800"> |
| 7967 | <td class="px-2 py-1 ${r.baseline ? '' : 'text-amber-300'}">${name}</td> |
| 7968 | <td class="px-2 py-1 font-mono">${(r.areas || []).join(', ') || '?'}</td> |
| 7969 | <td class="px-2 py-1 text-gray-400">L${(r.levels || []).join('/') || '?'}</td> |
| 7970 | <td class="px-2 py-1">${auth}</td> |
| 7971 | <td class="px-2 py-1">${badge}</td> |
| 7972 | </tr>`; |
| 7973 | }).join('') + |
| 7974 | '</tbody></table>'; |
| 7975 | } |
| 7976 | if ((d.prefixes || []).length) { |
| 7977 | html += '<p class="text-xs uppercase text-gray-400 mt-2 mb-1">Advertised prefixes (' + d.prefixes.length + ')</p>' + |
| 7978 | '<table class="min-w-full text-xs text-gray-300 whitespace-nowrap"><thead>' + |
nothing calls this directly
no test coverage detected