()
| 1592 | .foot{margin-top:26px;color:#999;font-size:11px} @media print{body{margin:0}} |
| 1593 | </style></head><body> |
| 1594 | <h1>WiFi Survey Report</h1> |
| 1595 | <div class="sub">${now.toLocaleString()} · interface ${_esc(_wifiState.iface || '—')} · ${aps.length} APs heard${_wifiHm.data && _wifiHm.data.target_ssid ? ' · target ' + _esc(_wifiHm.data.target_ssid) : ''}</div> |
| 1596 | ${cov ? '<h2>Coverage</h2>' + cov : ''} |
| 1597 | ${plan ? '<h2>Build plan</h2>' + plan : ''} |
| 1598 | ${img ? '<h2>Heatmap</h2>' + img : ''} |
| 1599 | ${bands ? '<h2>Bands & channel plan</h2>' + bands : ''} |
| 1600 | ${intf ? '<h2>Interference</h2>' + intf : ''} |
| 1601 | ${issues.length ? '<h2>Security issues (' + issues.length + ')</h2><ul>' + issues.map(a => `<li><b>${_esc(a.ssid) || 'hidden'}</b> (${_esc(a.bssid)}): ${_esc(a.security_findings.join('; '))}</li>`).join('') + '</ul>' : ''} |
| 1602 | <h2>AP inventory</h2> |
| 1603 | <table><thead><tr><th>SSID</th><th>BSSID</th><th>Vendor</th><th>Band</th><th>Ch</th><th>Width</th><th>RSSI</th><th>SNR</th><th>Security</th></tr></thead><tbody>${rows}</tbody></table> |
| 1604 | <div class="foot">Generated by Ragnar WiFi Analyzer. Passive survey — estimates, not survey-grade measurements.</div> |
| 1605 | <script>window.onload=function(){setTimeout(function(){window.print();},250);};<\/script> |
| 1606 | </body></html>`; |
| 1607 | const w = window.open('', '_blank'); |
| 1608 | if (!w) { alert('Allow pop-ups to generate the report.'); return; } |
| 1609 | w.document.open(); w.document.write(html); w.document.close(); |
| 1610 | } |
| 1611 | |
| 1612 | function wifiRender() { |
| 1613 | const d = _wifiState.data; if (!d) return; |
| 1614 | if (!_wifiState.apView) _wifiState.apView = 'aps'; |
| 1615 | if (!_wifiState.sortKey) { _wifiState.sortKey = 'signal'; _wifiState.sortDir = -1; } |
| 1616 | // Band summary chips (+ noise floor + width advice) |
| 1617 | const summ = document.getElementById('wifi-band-summary'); |
| 1618 | const ratingColor = { clear: '#22c55e', moderate: '#eab308', congested: '#ef4444' }; |
| 1619 | let chips = Object.keys(d.spectrum).sort().map(b => { |
| 1620 | const s = d.spectrum[b]; |
| 1621 | const wa = s.width_advice ? ` · <span title="${s.width_advice.reason}">→ ${s.width_advice.mhz}MHz</span>` : ''; |
| 1622 | return `<span class="px-2 py-1 rounded" style="background:${_WIFI_BAND_COLOR[b]}22;border:1px solid ${_WIFI_BAND_COLOR[b]}66"> |
| 1623 | <b style="color:${_WIFI_BAND_COLOR[b]}">${b} GHz</b> · ${s.ap_count} AP · |
| 1624 | <span style="color:${ratingColor[s.rating]}">${s.rating}</span> · best ch ${s.recommend.join(', ')}${wa}</span>`; |
| 1625 | }).join(''); |
nothing calls this directly
no test coverage detected