MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / getActiveWifiInterface

Function getActiveWifiInterface

web/scripts/ragnar_modern.js:8803–8818  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8801 sel.appendChild(o);
8802 });
8803 sel.dataset.filled = '1';
8804 }).catch(() => {});
8805}
8806async 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 }

Callers 7

refreshWifiStatusFunction · 0.70
scanWifiNetworksFunction · 0.70
displayWifiNetworksFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected