()
| 18764 | } else { |
| 18765 | passwordSection.style.display = 'block'; |
| 18766 | } |
| 18767 | } |
| 18768 | |
| 18769 | // Update button text for edit mode |
| 18770 | if (submitBtn) { |
| 18771 | submitBtn.textContent = editMode ? 'Update & Connect' : 'Connect'; |
| 18772 | } |
| 18773 | |
| 18774 | // Hide status |
| 18775 | if (statusDiv) { |
| 18776 | statusDiv.classList.add('hidden'); |
| 18777 | } |
| 18778 | |
| 18779 | // Show modal |
| 18780 | modal.classList.remove('hidden'); |
| 18781 | modal.classList.add('flex'); |
| 18782 | } |
| 18783 | |
| 18784 | function closeWifiConnectModal() { |
| 18785 | const modal = document.getElementById('wifi-connect-modal'); |
| 18786 | if (modal) { |
| 18787 | modal.classList.add('hidden'); |
| 18788 | modal.classList.remove('flex'); |
| 18789 | } |
| 18790 | selectedWifiNetwork = null; |
| 18791 | } |
| 18792 | |
| 18793 | async function forgetWifiNetwork(ssid) { |
| 18794 | if (!confirm(`Forget network "${ssid}"? You will need to re-enter the password to connect again.`)) { |
| 18795 | return; |
| 18796 | } |
| 18797 | try { |
| 18798 | const data = await postAPI('/api/wifi/forget', { ssid }); |
| 18799 | if (data.success) { |
nothing calls this directly
no test coverage detected