()
| 8801 | sel.appendChild(o); |
| 8802 | }); |
| 8803 | sel.dataset.filled = '1'; |
| 8804 | }).catch(() => {}); |
| 8805 | } |
| 8806 | async function runMacWatch(scan) { |
| 8807 | const out = document.getElementById('macwatch-results'); |
| 8808 | if (!out) return; |
| 8809 | const btn = (typeof event !== 'undefined' && event && event.target) ? event.target : null; |
| 8810 | const ifaceSel = document.getElementById('macwatch-iface'); |
| 8811 | const iface = ifaceSel && ifaceSel.value ? ifaceSel.value : ''; |
| 8812 | _ndBusy(btn, true, scan ? 'Scanning…' : 'Reading…'); |
| 8813 | out.classList.remove('hidden'); |
| 8814 | out.innerHTML = '<p class="text-sm text-gray-400">' + (scan ? ('Sweeping ' + (iface ? escapeHtml(iface) : 'the default segment') + ' (arp-scan)…') : 'Reading neighbour table…') + '</p>'; |
| 8815 | try { |
| 8816 | _macWatchFillIfaces(); |
| 8817 | const d = await fetchAPI('/api/net/mac-watch?scan=' + (scan ? '1' : '0') + (iface ? '&interface=' + encodeURIComponent(iface) : '')); |
| 8818 | if (!d || d.success === false) { |
| 8819 | out.innerHTML = '<p class="text-sm text-red-400">Error: ' + escapeHtml((d && d.error) || 'failed') + '</p>'; |
| 8820 | return; |
| 8821 | } |
no outgoing calls
no test coverage detected