From: Jo-Philipp Wich Date: Fri, 29 Jun 2018 15:48:31 +0000 (+0200) Subject: luci-mod-admin-full: rework wireless network status indicator X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b693baaa6ea4dc8bf877d7cee748def8efe0ced0;p=oweals%2Fluci.git luci-mod-admin-full: rework wireless network status indicator Rework markup and logic of the wireless network status indicator to match that of the interface status widget. Signed-off-by: Jo-Philipp Wich --- 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 85468252e..ad20ea38f 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 @@ -24,21 +24,22 @@ else icon = "<%=resource%>/icons/signal-75-100.png"; - var s = document.getElementById('<%=self.option%>-iw-signal'); - if (s) - s.innerHTML = String.format( - '
' + - '%d%%', icon, iw.signal, iw.noise, p - ); + var s = document.getElementById('<%=self.option%>-iw-status'), + small = s.querySelector('small'), + info = s.querySelector('span'); + + small.innerHTML = info.innerHTML = String.format( + ' 
%d%% ', + icon, iw.signal, iw.noise, p + ); - var d = document.getElementById('<%=self.option%>-iw-description'); - if (d && is_assoc) - d.innerHTML = String.format( + if (is_assoc) + info.innerHTML = String.format( '<%:Mode%>: %s | ' + '<%:SSID%>: %h
' + - '<%:BSSID%>: %s | ' + + '<%:BSSID%>: %s
' + '<%:Encryption%>: %s
' + - '<%:Channel%>: %d (%.3f <%:GHz%>) | ' + + '<%:Channel%>: %d (%.3f <%:GHz%>)
' + '<%:Tx-Power%>: %d <%:dBm%>
' + '<%:Signal%>: %d <%:dBm%> | ' + '<%:Noise%>: %d <%:dBm%>
' + @@ -50,8 +51,8 @@ iw.txpower, iw.signal, iw.noise, iw.bitrate ? iw.bitrate : 0, iw.country ); - else if (d) - d.innerHTML = String.format( + else + info.innerHTML = String.format( '<%:SSID%>: %h | ' + '<%:Mode%>: %s
' + '<%:Wireless is disabled or not associated%>', @@ -62,17 +63,13 @@ ); //]]> -
-
-
-
-
- 0% -
-
- <%:Collecting data...%> -
-
-
+ + +   + + + <%:Collecting data...%> + + <%+cbi/valuefooter%>