(ip)
| 3314 | const f = e.target.files[0]; if (!f) return; |
| 3315 | const rd = new FileReader(); |
| 3316 | rd.onload = () => { |
| 3317 | const sel = document.getElementById('wifi-hm-ap'); |
| 3318 | const bssid = sel.value || null; |
| 3319 | const ap = (_wifiState.data && _wifiState.data.aps || []).find(a => a.bssid === bssid); |
| 3320 | fetch('/api/net/wifi/heatmap', { method: 'POST', headers: { 'Content-Type': 'application/json' }, |
| 3321 | body: JSON.stringify({ action: 'floorplan', floorplan: rd.result, bssid: bssid, ssid: ap && ap.ssid }) }) |
| 3322 | .then(() => wifiHeatmapLoad()); |
| 3323 | }; |
| 3324 | rd.readAsDataURL(f); |
| 3325 | }); |
| 3326 | const sc = document.getElementById('wifi-hm-scale'); |
| 3327 | try { const s = localStorage.getItem('wifiHmFloorM'); if (sc && s) sc.value = s; } catch (_) {} |
| 3328 | _wifiHmSyncScaleUI(); |
| 3329 | window.addEventListener('resize', () => { if (document.getElementById('wifi-heatmap')) _wifiHmDragRender(); }); |
| 3330 | const cv = document.getElementById('wifi-heatmap'); |
| 3331 | if (cv) cv.addEventListener('click', (e) => { |
| 3332 | // A just-finished drag/pan (or a press on an existing object) must not |
| 3333 | // also place a new AP / sample here. |
| 3334 | if (_wifiHm.suppressClick) { _wifiHm.suppressClick = false; return; } |
no test coverage detected