()
| 19763 | targetClass = config.smallClass; |
| 19764 | } else if (digitCount >= config.mediumDigits) { |
| 19765 | targetClass = config.mediumClass; |
| 19766 | } else { |
| 19767 | targetClass = config.baseClass; |
| 19768 | } |
| 19769 | |
| 19770 | if (!element.classList.contains(targetClass)) { |
| 19771 | element.classList.remove(config.baseClass, config.mediumClass, config.smallClass); |
| 19772 | element.classList.add(targetClass); |
| 19773 | } |
| 19774 | } |
| 19775 | |
| 19776 | function updateConnectivityIndicator(id, active, ssid = null, apMode = false) { |
| 19777 | const element = document.getElementById(id); |
| 19778 | if (element) { |
| 19779 | const targetClass = active |
| 19780 | ? 'w-3 h-3 bg-green-500 rounded-full pulse-glow' |
| 19781 | : 'w-3 h-3 bg-gray-600 rounded-full'; |
| 19782 | if (element.className !== targetClass) { |
| 19783 | element.className = targetClass; |
| 19784 | } |
| 19785 | } |
| 19786 | |
| 19787 | // Update WiFi SSID display if this is the WiFi indicator |
| 19788 | if (id === 'wifi-status') { |
| 19789 | const ssidDisplay = document.getElementById('wifi-ssid-display'); |
| 19790 | if (ssidDisplay) { |
| 19791 | let text, cls; |
| 19792 | if (apMode) { |
| 19793 | text = ssid ? `AP Mode: ${ssid}` : 'AP Mode'; |
| 19794 | cls = 'text-xs text-blue-400 truncate'; |
| 19795 | } else if (active && ssid) { |
| 19796 | text = ssid; |
| 19797 | cls = 'text-xs text-gray-400 truncate'; |
| 19798 | } else { |
| 19799 | text = 'Not connected'; |
| 19800 | cls = 'text-xs text-gray-500 truncate'; |
| 19801 | } |
| 19802 | if (ssidDisplay.textContent !== text) ssidDisplay.textContent = text; |
| 19803 | if (ssidDisplay.className !== cls) ssidDisplay.className = cls; |
| 19804 | } |
| 19805 | } |
| 19806 | } |
| 19807 | |
| 19808 | function updateLanIndicator(data) { |
| 19809 | const dot = document.getElementById('lan-status'); |
| 19810 | const info = document.getElementById('lan-info-display'); |
| 19811 | if (!dot && !info) return; |
| 19812 | |
| 19813 | if (data.ethernet_connected) { |
| 19814 | const targetClass = 'w-3 h-3 bg-green-500 rounded-full pulse-glow'; |
| 19815 | if (dot && dot.className !== targetClass) dot.className = targetClass; |
| 19816 | if (info) { |
| 19817 | const iface = data.ethernet_interface || 'eth0'; |
| 19818 | const ip = data.ethernet_ip || ''; |
| 19819 | const text = ip ? `${iface}: ${ip}` : iface; |
| 19820 | const cls = 'text-xs text-green-400 truncate'; |
| 19821 | if (info.textContent !== text) info.textContent = text; |
| 19822 | if (info.className !== cls) info.className = cls; |
nothing calls this directly
no test coverage detected