var iwxhr = new XHR();
(function() {
iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null,
- function(x)
+ function(x, iw)
{
- var iw = x.responseText ? eval('(' + x.responseText + ')') : null;
- if (iw)
+ if (iw && (iw = iw[0]))
{
var is_assoc = (iw.bssid && iw.channel);
var p = (100 / iw.quality_max * iw.quality);
var s = document.getElementById('<%=self.option%>-iw-signal');
if (s)
s.innerHTML = String.format(
- '<img src="%s" title="Signal: %d dBm / Noise: %d dBm" /><br />' +
+ '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" /><br />' +
'<small>%d%%</small>', icon, iw.signal, iw.noise, p
);
var d = document.getElementById('<%=self.option%>-iw-description');
if (d && is_assoc)
d.innerHTML = String.format(
- '<strong><%:Mode%>:</strong> %s |' +
+ '<strong><%:Mode%>:</strong> %s | ' +
'<strong><%:SSID%>:</strong> %s<br />' +
- '<strong><%:BSSID%>:</strong> %s |' +
+ '<strong><%:BSSID%>:</strong> %s | ' +
'<strong><%:Encryption%>:</strong> %s<br />' +
- '<strong><%:Channel%>:</strong> %d (%.3f GHz) |' +
+ '<strong><%:Channel%>:</strong> %d (%.3f GHz) | ' +
'<strong><%:Tx-Power%>:</strong> %d dBm<br />' +
- '<strong><%:Signal%>:</strong> %d dBm |' +
+ '<strong><%:Signal%>:</strong> %d dBm | ' +
'<strong><%:Noise%>:</strong> %d dBm<br />' +
- '<strong><%:Bit Rate%>:</strong> %.1f MBit/s |' +
+ '<strong><%:Bit Rate%>:</strong> %.1f MBit/s | ' +
'<strong><%:Country%>:</strong> %s',
iw.mode, iw.ssid, iw.bssid,
iw.encryption ? iw.encryption.description : '<%:None%>',