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 <jo@mein.io>
This commit is contained in:
parent
3aba615029
commit
b693baaa6e
1 changed files with 22 additions and 25 deletions
|
@ -24,21 +24,22 @@
|
||||||
else
|
else
|
||||||
icon = "<%=resource%>/icons/signal-75-100.png";
|
icon = "<%=resource%>/icons/signal-75-100.png";
|
||||||
|
|
||||||
var s = document.getElementById('<%=self.option%>-iw-signal');
|
var s = document.getElementById('<%=self.option%>-iw-status'),
|
||||||
if (s)
|
small = s.querySelector('small'),
|
||||||
s.innerHTML = String.format(
|
info = s.querySelector('span');
|
||||||
'<img src="%s" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%>" /><br />' +
|
|
||||||
'<small>%d%%</small>', icon, iw.signal, iw.noise, p
|
small.innerHTML = info.innerHTML = String.format(
|
||||||
|
'<img src="%s" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%>" /> <br />%d%% ',
|
||||||
|
icon, iw.signal, iw.noise, p
|
||||||
);
|
);
|
||||||
|
|
||||||
var d = document.getElementById('<%=self.option%>-iw-description');
|
if (is_assoc)
|
||||||
if (d && is_assoc)
|
info.innerHTML = String.format(
|
||||||
d.innerHTML = String.format(
|
|
||||||
'<strong><%:Mode%>:</strong> %s | ' +
|
'<strong><%:Mode%>:</strong> %s | ' +
|
||||||
'<strong><%:SSID%>:</strong> %h<br />' +
|
'<strong><%:SSID%>:</strong> %h<br />' +
|
||||||
'<strong><%:BSSID%>:</strong> %s | ' +
|
'<strong><%:BSSID%>:</strong> %s<br />' +
|
||||||
'<strong><%:Encryption%>:</strong> %s<br />' +
|
'<strong><%:Encryption%>:</strong> %s<br />' +
|
||||||
'<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>) | ' +
|
'<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' +
|
||||||
'<strong><%:Tx-Power%>:</strong> %d <%:dBm%><br />' +
|
'<strong><%:Tx-Power%>:</strong> %d <%:dBm%><br />' +
|
||||||
'<strong><%:Signal%>:</strong> %d <%:dBm%> | ' +
|
'<strong><%:Signal%>:</strong> %d <%:dBm%> | ' +
|
||||||
'<strong><%:Noise%>:</strong> %d <%:dBm%><br />' +
|
'<strong><%:Noise%>:</strong> %d <%:dBm%><br />' +
|
||||||
|
@ -50,8 +51,8 @@
|
||||||
iw.txpower, iw.signal, iw.noise,
|
iw.txpower, iw.signal, iw.noise,
|
||||||
iw.bitrate ? iw.bitrate : 0, iw.country
|
iw.bitrate ? iw.bitrate : 0, iw.country
|
||||||
);
|
);
|
||||||
else if (d)
|
else
|
||||||
d.innerHTML = String.format(
|
info.innerHTML = String.format(
|
||||||
'<strong><%:SSID%>:</strong> %h | ' +
|
'<strong><%:SSID%>:</strong> %h | ' +
|
||||||
'<strong><%:Mode%>:</strong> %s<br />' +
|
'<strong><%:Mode%>:</strong> %s<br />' +
|
||||||
'<em><%:Wireless is disabled or not associated%></em>',
|
'<em><%:Wireless is disabled or not associated%></em>',
|
||||||
|
@ -62,17 +63,13 @@
|
||||||
);
|
);
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
<div class="table">
|
<span class="ifacebadge large" id="<%=self.option%>-iw-status">
|
||||||
<div class="tr cbi-section-table">
|
<small>
|
||||||
<div class="td"></div>
|
<img src="<%=resource%>/icons/signal-none.png" title="<%:Not associated%>" /> 
|
||||||
<div class="td cbi-value-field" style="width:16px; padding:3px" id="<%=self.option%>-iw-signal">
|
</small>
|
||||||
<img src="<%=resource%>/icons/signal-none.png" title="<%:Not associated%>" /><br />
|
<span>
|
||||||
<small>0%</small>
|
|
||||||
</div>
|
|
||||||
<div class="td cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px" id="<%=self.option%>-iw-description">
|
|
||||||
<em><%:Collecting data...%></em>
|
<em><%:Collecting data...%></em>
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</span>
|
||||||
</div>
|
|
||||||
|
|
||||||
<%+cbi/valuefooter%>
|
<%+cbi/valuefooter%>
|
||||||
|
|
Loading…
Reference in a new issue