()
| 5449 | btn.textContent = 'Dedicated monitor (' + (_wifidef.monitor || '') + ') — boot-managed'; |
| 5450 | btn.classList.remove('text-red-300'); |
| 5451 | btn.disabled = true; |
| 5452 | btn.classList.add('opacity-60', 'cursor-not-allowed'); |
| 5453 | return; |
| 5454 | } |
| 5455 | btn.disabled = false; |
| 5456 | btn.classList.remove('opacity-60', 'cursor-not-allowed'); |
| 5457 | if (_wifidef.monitor) { |
| 5458 | btn.textContent = 'Disable monitor (' + _wifidef.monitor + ')'; |
| 5459 | btn.classList.add('text-red-300'); |
| 5460 | } else { |
| 5461 | btn.textContent = 'Enable monitor'; |
| 5462 | btn.classList.remove('text-red-300'); |
| 5463 | } |
| 5464 | } |
| 5465 | |
| 5466 | function wifidefToggleMonitor() { |
| 5467 | const st = document.getElementById('wifidef-status'); |
| 5468 | // Boot-dedicated monitor is managed by systemd; the UI must not toggle it. |
| 5469 | if (_wifidef.dedicated) { |
| 5470 | if (st) st.textContent = 'Adapter is a boot-dedicated monitor (managed by ragnar-wifidef-monitor.service)'; |
| 5471 | return; |
| 5472 | } |
| 5473 | if (_wifidef.monitor) { |
| 5474 | // Stop any continuous scan first — otherwise its next loop would |
no test coverage detected