()
| 8837 | const d = await fetchAPI('/api/net/isis-watch' + qs); |
| 8838 | if (!d || d.success === false) { |
| 8839 | const msg = (d && d.error) || 'failed'; |
| 8840 | let extra = ''; |
| 8841 | if (d && d.missing_tool) extra = ' <button onclick="installNetTool(\'tcpdump\', this, runIsisWatch)" class="ml-2 underline text-cyan-400">Install tcpdump</button>'; |
| 8842 | out.innerHTML = '<p class="text-sm text-red-400">Error: ' + escapeHtml(msg) + extra + '</p>'; |
| 8843 | return; |
| 8844 | } |
| 8845 | const [cls, label] = _ISIS_VERDICT_STYLE[d.verdict] || _ISIS_VERDICT_STYLE.unknown; |
| 8846 | let html = `<div class="mb-2 px-3 py-2 rounded border ${cls} text-sm">${label}</div>`; |
| 8847 | 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>`; |
| 8848 | if ((d.routers || []).length) { |
| 8849 | html += '<p class="text-xs uppercase text-gray-400 mt-2 mb-1">IS-IS routers (' + d.routers.length + ')</p>' + |
no test coverage detected