(activeInterface)
| 8846 | const body = { |
| 8847 | action: 'start', |
| 8848 | peer_ip: (document.getElementById('bgpc-peer').value || '').trim(), |
| 8849 | peer_as: parseInt(document.getElementById('bgpc-peeras').value, 10), |
| 8850 | local_as: parseInt(document.getElementById('bgpc-localas').value, 10), |
| 8851 | router_id: (document.getElementById('bgpc-rid').value || '').trim(), |
| 8852 | }; |
| 8853 | d = await postAPI('/api/net/bgp-collector', body); |
| 8854 | } else { |
| 8855 | d = await postAPI('/api/net/bgp-collector', { action }); |
| 8856 | } |
| 8857 | if (!out) return; |
| 8858 | if (!d.success) { out.innerHTML = '<span class="text-red-300">' + escapeHtml(d.error || 'failed') + '</span>'; return; } |
| 8859 | if (action === 'rib') { |
| 8860 | const rib = d.rib || { total: 0, routes: [] }; |
| 8861 | let h = '<div class="text-xs text-gray-400 mb-1">RIB: ' + rib.total + ' prefixes · session ' + escapeHtml(d.state || '?') + '</div>'; |
| 8862 | if (rib.routes && rib.routes.length) { |
| 8863 | h += '<table class="w-full text-xs"><tr class="text-gray-500 text-left"><th class="pr-3">Prefix</th><th class="pr-3">Origin AS</th><th class="pr-3">AS-path</th><th>Flapping</th></tr>'; |
| 8864 | for (const r of rib.routes) { |
no test coverage detected