()
| 3095 | // (a fresh scan can momentarily miss the AP → "bssid not found"). |
| 3096 | let known = ''; |
| 3097 | if (ap && ap.signal != null) { |
| 3098 | known = `&signal=${ap.signal}&freq=${ap.freq || ''}¢er_freq=${ap.center_freq || ''}` |
| 3099 | + `&band=${encodeURIComponent(ap.band || '')}&channel=${ap.channel != null ? ap.channel : ''}` |
| 3100 | + `&ssid=${encodeURIComponent(ap.ssid || '')}` |
| 3101 | + `&tx_measured=${ap.tx_power_dbm != null ? ap.tx_power_dbm : ''}`; |
| 3102 | } |
| 3103 | document.getElementById('wifi-radius-controls').style.display = 'flex'; |
| 3104 | document.getElementById('wifi-cal-details').style.display = 'block'; |
| 3105 | fetch(`/api/net/wifi/radius?interface=${encodeURIComponent(iface)}&bssid=${encodeURIComponent(bssid)}&tx=${tx}&ple=${ple}&rssi_offset=${rssiOffset}&antenna_gain=${antGain}&cable_loss=${cableLoss}${rssi0}${known}`) |
| 3106 | .then(r => r.json()).then(d => { |
| 3107 | if (d.error) { |
| 3108 | document.getElementById('wifi-radius-info').innerHTML = '<span class="text-amber-400">' + d.error + '</span>'; |
| 3109 | _wifiState.radius = null; _wifiFsRenderSide(); |
| 3110 | return; |
| 3111 | } |
| 3112 | // Kept for the full-screen inspector, which shows the same model. |
| 3113 | _wifiState.radius = d; |
| 3114 | _wifiFsRenderSide(); |
| 3115 | _wifiDrawRadius(d); |
| 3116 | document.getElementById('wifi-radius-target').textContent = '· ' + (d.ssid || bssid); |
| 3117 | const srcMap = { measured: '<span class="text-green-400">measured</span>', calibrated: '<span class="text-cyan-400">calibrated</span>' }; |
| 3118 | const src = srcMap[d.assumptions.tx_source] || 'assumed'; |
| 3119 | const a = d.assumptions; |
| 3120 | const adj = (d.signal_adjusted != null && d.signal_adjusted !== d.signal) ? ` (adj ${d.signal_adjusted})` : ''; |
no test coverage detected