From a82b30179bc636d57fda06909aa78fd7272c22ae Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 18 Mar 2025 00:55:56 -0700 Subject: [PATCH] Add device, clients active/inactive states --- includes/dashboard.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/dashboard.php b/includes/dashboard.php index b2c022a4..c6e2d686 100755 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -50,15 +50,18 @@ function DisplayDashboard(): void $ipv4Netmask = $details['ipv4_netmask']; $macAddress = $details['mac']; $ssid = $wireless['ssid']; - $ethernetActive = ($connectionType === 'ethernet') ? "active" : ""; - $wirelessActive = ($connectionType === 'wireless') ? "active" : ""; - $tetheringActive = ($connectionType === 'tethering') ? "active" : ""; - $cellularActive = ($connectionType === 'cellular') ? "active" : ""; + $ethernetActive = ($connectionType === 'ethernet') ? "active" : "inactive"; + $wirelessActive = ($connectionType === 'wireless') ? "active" : "inactive"; + $tetheringActive = ($connectionType === 'tethering') ? "active" : "inactive"; + $cellularActive = ($connectionType === 'cellular') ? "active" : "inactive"; $bridgedStatus = ($bridgedEnable == 1) ? "active" : ""; $hostapdStatus = ($hostapd[0] == 1) ? "active" : ""; $adblockStatus = ($adblock == true) ? "active" : ""; + $wirelessClientActive = ($wirelessClients > 0) ? "active" : "inactive"; $wirelessClientLabel = $wirelessClients. ' WLAN '.$dashboard->formatClientLabel($wirelessClients); + $ethernetClientActive = ($ethernetClients > 0) ? "active" : "inactive"; $ethernetClientLabel = $ethernetClients. ' LAN '.$dashboard->formatClientLabel($ethernetClients); + $totalClientsActive = ($totalClients > 0) ? "active": "inactive"; $freq5active = $freq24active = ""; $varName = "freq" . str_replace('.', '', $frequency) . "active"; $$varName = "active"; @@ -95,10 +98,13 @@ function DisplayDashboard(): void "freq5active", "freq24active", "wirelessClients", - "ethernetClients", "wirelessClientLabel", + "wirelessClientActive", + "ethernetClients", "ethernetClientLabel", + "ethernetClientActive", "totalClients", + "totalClientsActive", "connectionType", "connectionIcon", "ethernetActive",