From aef1c2fca0360f1b9ddd7327beabfef7b6b37514 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Jul 2018 14:08:17 +0200 Subject: luci-mod-admin-full: differentiate between disabled and not associated wireless Signed-off-by: Jo-Philipp Wich --- .../luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm | 8 +++++--- modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm index ad20ea38fe..bfad3d0804 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm @@ -8,7 +8,7 @@ { var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && !iw.disabled); var p = iw.quality; - var q = is_assoc ? p : -1; + var q = iw.disabled ? -1 : p; var icon; if (q < 0) @@ -55,8 +55,10 @@ info.innerHTML = String.format( '<%:SSID%>: %h | ' + '<%:Mode%>: %s
' + - '<%:Wireless is disabled or not associated%>', - iw.ssid || '?', iw.mode + '%s', + iw.ssid || '?', iw.mode, + iw.disabled ? '<%:Wireless is disabled%>' + : '<%:Wireless is not associated%>' ); } } diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm index 03155dbb62..db8535086f 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -299,9 +299,9 @@ var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled); var icon; - if (!is_assoc) + if (net.disabled) icon = "<%=resource%>/icons/signal-none.png"; - else if (net.quality == 0) + else if (net.quality <= 0) icon = "<%=resource%>/icons/signal-0.png"; else if (net.quality < 25) icon = "<%=resource%>/icons/signal-0-25.png"; @@ -320,7 +320,7 @@ '<%:BSSID%>', is_assoc ? (net.bssid || '-') : null, '<%:Encryption%>', is_assoc ? net.encryption : null, '<%:Associations%>', is_assoc ? (net.num_assoc || '-') : null, - null, is_assoc ? null : E('em', '<%:Wireless is disabled or not associated%>'))); + null, is_assoc ? null : E('em', net.disabled ? '<%:Wireless is disabled%>' : '<%:Wireless is not associated%>'))); } ws.appendChild(renderBox( -- cgit v1.2.3