3 <script type=
"text/javascript">//<![CDATA[
4 XHR.poll(
5, '<%=url('admin/network/wireless_status', self.ifname)%
>', null,
7 if (iw && (iw = iw[
0]))
9 var is_assoc = (iw.bssid && iw.bssid != '
00:
00:
00:
00:
00:
00' && iw.channel && !iw.disabled);
11 var q = iw.disabled ? -
1 : p;
15 icon =
"<%=resource%>/icons/signal-none.png";
17 icon =
"<%=resource%>/icons/signal-0.png";
19 icon =
"<%=resource%>/icons/signal-0-25.png";
21 icon =
"<%=resource%>/icons/signal-25-50.png";
23 icon =
"<%=resource%>/icons/signal-50-75.png";
25 icon =
"<%=resource%>/icons/signal-75-100.png";
27 var s = document.getElementById('<%=self.option%
>-iw-status'),
28 small = s.querySelector('small'),
29 info = s.querySelector('span');
31 small.innerHTML = info.innerHTML = String.format(
32 '
<img src=
"%s" title=
"<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%>" /> <br />%d%%
 ',
33 icon, iw.signal, iw.noise, p
37 info.innerHTML = String.format(
38 '
<strong><%:Mode%
>:
</strong> %s | ' +
39 '
<strong><%:SSID%
>:
</strong> %h
<br />' +
40 '
<strong><%:BSSID%
>:
</strong> %s
<br />' +
41 '
<strong><%:Encryption%
>:
</strong> %s
<br />' +
42 '
<strong><%:Channel%
>:
</strong> %d (%
.3f <%:GHz%
>)
<br />' +
43 '
<strong><%:Tx-Power%
>:
</strong> %d <%:dBm%
><br />' +
44 '
<strong><%:Signal%
>:
</strong> %d <%:dBm%
> | ' +
45 '
<strong><%:Noise%
>:
</strong> %d <%:dBm%
><br />' +
46 '
<strong><%:Bitrate%
>:
</strong> %
.1f <%:Mbit/s%
> | ' +
47 '
<strong><%:Country%
>:
</strong> %s',
48 iw.mode, iw.ssid, iw.bssid,
49 iw.encryption ? iw.encryption : '<%:None%
>',
50 iw.channel, iw.frequency ? iw.frequency :
0,
51 iw.txpower, iw.signal, iw.noise,
52 iw.bitrate ? iw.bitrate :
0, iw.country
55 info.innerHTML = String.format(
56 '
<strong><%:SSID%
>:
</strong> %h | ' +
57 '
<strong><%:Mode%
>:
</strong> %s
<br />' +
59 iw.ssid || '?', iw.mode,
60 iw.disabled ? '
<em><%:Wireless is disabled%
></em>'
61 : '
<em><%:Wireless is not associated%
></em>'
68 <span class=
"ifacebadge large" id=
"<%=self.option%>-iw-status">
70 <img src=
"<%=resource%>/icons/signal-none.png" title=
"<%:Not associated%>" /> 
73 <em><%:Collecting data...%
></em>