(data)
| 20104 | |
| 20105 | // Update mode and handle manual controls |
| 20106 | const automationEnabled = typeof data.automation_enabled === 'boolean' ? data.automation_enabled : !Boolean(data.manual_mode); |
| 20107 | const isManualMode = Boolean(data.manual_mode); |
| 20108 | |
| 20109 | let modeLabel = 'Auto'; |
| 20110 | let modeClass = 'text-green-400 font-semibold'; |
| 20111 | if (!automationEnabled) { |
| 20112 | modeLabel = 'Sleeping'; |
| 20113 | modeClass = 'text-purple-300 font-semibold'; |
| 20114 | } else if (isManualMode) { |
| 20115 | modeLabel = 'Manual'; |
| 20116 | modeClass = 'text-orange-400 font-semibold'; |
| 20117 | } |
| 20118 | |
| 20119 | updateElement('Ragnar-mode', modeLabel); |
| 20120 | |
| 20121 | const modeElement = document.getElementById('Ragnar-mode'); |
| 20122 | if (modeElement) { |
| 20123 | modeElement.className = modeClass; |
| 20124 | } |
| 20125 | |
| 20126 | syncManualModeUI(isManualMode); |
| 20127 | updateAutomationToggleButton(automationEnabled); |
| 20128 | |
| 20129 | // Update connectivity status with WiFi SSID |
| 20130 | updateConnectivityIndicator('wifi-status', data.wifi_connected, data.current_ssid, data.ap_mode_active); |
| 20131 | updateConnectivityIndicator('bluetooth-status', data.bluetooth_active); |
| 20132 | updateConnectivityIndicator('usb-status', data.usb_active); |
| 20133 | updateConnectivityIndicator('pan-status', data.pan_connected); |
| 20134 | updateLanIndicator(data); |
| 20135 | |
| 20136 | // Update the primary connection card |
| 20137 | updatePrimaryConnectionCard(data); |
| 20138 | |
| 20139 | updateReleaseGateState(data.release_gate); |
| 20140 | updatePwnToggleAvailability(Boolean(data.headless_mode)); |
no test coverage detected