()
| 2898 | if (typing) return; |
| 2899 | if (e.key === 'ArrowDown') { e.preventDefault(); _wifiFsStep(1); } |
| 2900 | else if (e.key === 'ArrowUp') { e.preventDefault(); _wifiFsStep(-1); } |
| 2901 | else if (e.key === 's' || e.key === 'S') wifiScan(); |
| 2902 | else if (e.key === 'b' || e.key === 'B') wifiSetView('bar'); |
| 2903 | else if (e.key === 'd' || e.key === 'D') wifiSetView('dome'); |
| 2904 | else if (e.key === 'a' || e.key === 'A') wifiSetBand('all'); |
| 2905 | else if (e.key === '2') wifiSetBand('2.4'); |
| 2906 | else if (e.key === '5') wifiSetBand('5'); |
| 2907 | else if (e.key === '6') wifiSetBand('6'); |
| 2908 | } |
| 2909 | |
| 2910 | // Walk the currently-filtered list with the arrow keys. |
| 2911 | function _wifiFsStep(delta) { |
| 2912 | const aps = _wifiFsAps(); |
| 2913 | if (!aps.length) return; |
| 2914 | const i = aps.findIndex(a => a.bssid === _wifiState.selected); |
| 2915 | const next = aps[Math.max(0, Math.min(aps.length - 1, i < 0 ? 0 : i + delta))]; |
| 2916 | if (next) { |
| 2917 | wifiSelectAp(next.bssid); |
| 2918 | const row = document.querySelector(`#wifi-fs-list tr[data-b="${next.bssid}"]`); |
| 2919 | if (row && row.scrollIntoView) row.scrollIntoView({ block: 'nearest' }); |
| 2920 | } |
| 2921 | } |
| 2922 | |
| 2923 | function _wifiFsAps() { |
| 2924 | const g = id => (document.getElementById(id) || {}); |
| 2925 | return _wifiFilterAps(g('wifi-fs-search').value, g('wifi-fs-std').value || '', !!g('wifi-fs-issues').checked); |
| 2926 | } |
no test coverage detected