@@ -12,8 +12,9 @@ local M = {}
12
12
function M .getDevicesCardHTML (all )
13
13
local devices_data = {
14
14
numWireless = " sys.hosts.WirelessNumberOfEntries" ,
15
+ numEthernet = " sys.hosts.EthernetNumberOfEntries" ,
15
16
activeWireless = " sys.hosts.ActiveWirelessNumberOfEntries" ,
16
- numEthernet = " sys.hosts.ActiveEthernetNumberOfEntries" ,
17
+ activeEthernet = " sys.hosts.ActiveEthernetNumberOfEntries" ,
17
18
}
18
19
content_helper .getExactContent (devices_data )
19
20
@@ -33,10 +34,11 @@ function M.getDevicesCardHTML(all)
33
34
end
34
35
35
36
local nEth = tonumber (devices_data [" numEthernet" ]) or 0
36
- local nWiFi = tonumber (devices_data [" activeWireless" ]) or 0
37
- local iWiFi = (tonumber (devices_data [" numWireless" ]) or 0 ) - nWiFi
37
+ local activeEth = tonumber (devices_data [" activeEthernet" ]) or 0
38
+ local activeWiFi = tonumber (devices_data [" activeWireless" ]) or 0
39
+ local inactive = ((tonumber (devices_data [" numWireless" ]) or 0 ) - activeWiFi ) + (nEth - activeEth )
38
40
if multiap and nAgtDevices > 0 and nEth > nAgtDevices then
39
- nEth = nEth - nAgtDevices
41
+ activeEth = nEth - nAgtDevices
40
42
end
41
43
42
44
local bwstats_enabled = proxy .get (" rpc.gui.bwstats.enabled" )
@@ -45,15 +47,15 @@ function M.getDevicesCardHTML(all)
45
47
46
48
html [# html + 1 ] = ' <span class="simple-desc">'
47
49
html [# html + 1 ] = ' <i class="icon-link status-icon"></i>'
48
- html [# html + 1 ] = format (N (' <strong %s>%d ethernet device</strong> connected' ,' <strong %s>%d ethernet devices</strong> connected' ,nEth ),device_modal_link ,nEth )
50
+ html [# html + 1 ] = format (N (' <strong %s>%d ethernet device</strong> connected' ,' <strong %s>%d ethernet devices</strong> connected' ,activeEth ),device_modal_link ,activeEth )
49
51
html [# html + 1 ] = ' </span>'
50
52
html [# html + 1 ] = ' <span class="simple-desc">'
51
53
html [# html + 1 ] = ' <i class="icon-wifi status-icon"></i>'
52
- html [# html + 1 ] = format (N (' <strong %s>%d Wi-Fi device</strong> active' ,' <strong %s>%d Wi-Fi devices</strong> active' ,nWiFi ),device_modal_link ,nWiFi )
54
+ html [# html + 1 ] = format (N (' <strong %s>%d Wi-Fi device</strong> active' ,' <strong %s>%d Wi-Fi devices</strong> active' ,activeWiFi ),device_modal_link ,activeWiFi )
53
55
html [# html + 1 ] = ' </span>'
54
56
html [# html + 1 ] = ' <span class="simple-desc">'
55
57
html [# html + 1 ] = ' <i class="icon-wifi" style="color:grey"></i>'
56
- html [# html + 1 ] = format (N (' <strong %s>%d Wi-Fi device</strong> inactive' ,' <strong %s>%d Wi-Fi devices</strong> inactive' ,iWiFi ),all_devices_modal_link ,iWiFi )
58
+ html [# html + 1 ] = format (N (' <strong %s>%d device</strong> inactive' ,' <strong %s>%d devices</strong> inactive' ,inactive ),all_devices_modal_link ,inactive )
57
59
html [# html + 1 ] = ' </span>'
58
60
if all and multiap then
59
61
html [# html + 1 ] = ' <span class="simple-desc">'
0 commit comments