3 <script type=
"text/javascript"><![CDATA[
6 iwxhr.get('<%=luci.dispatcher.build_url(
"admin",
"network",
"wireless_status", self.ifname)%
>', null,
9 var iw = x.responseText ? eval('(' + x.responseText + ')') : null;
10 if (iw && (iw = iw[
0]))
12 var is_assoc = (iw.bssid && iw.channel);
13 var p = (
100 / iw.quality_max * iw.quality);
14 var q = is_assoc ? p : -
1;
18 icon =
"<%=resource%>/icons/signal-none.png";
20 icon =
"<%=resource%>/icons/signal-0.png";
22 icon =
"<%=resource%>/icons/signal-0-25.png";
24 icon =
"<%=resource%>/icons/signal-25-50.png";
26 icon =
"<%=resource%>/icons/signal-50-75.png";
28 icon =
"<%=resource%>/icons/signal-75-100.png";
30 var s = document.getElementById('<%=self.option%
>-iw-signal');
32 s.innerHTML = String.format(
33 '
<img src=
"%s" title=
"<%:Signal%>: %d dBm / <%Noise%>: %d dBm" /><br />' +
34 '
<small>%d%%
</small>', icon, iw.signal, iw.noise, p
37 var d = document.getElementById('<%=self.option%
>-iw-description');
39 d.innerHTML = String.format(
40 '
<strong><%:Mode%
>:
</strong> %s | ' +
41 '
<strong><%:SSID%
>:
</strong> %s
<br />' +
42 '
<strong><%:BSSID%
>:
</strong> %s | ' +
43 '
<strong><%:Encryption%
>:
</strong> %s
<br />' +
44 '
<strong><%:Channel%
>:
</strong> %d (%
.3f GHz) | ' +
45 '
<strong><%:Tx-Power%
>:
</strong> %d dBm
<br />' +
46 '
<strong><%:Signal%
>:
</strong> %d dBm | ' +
47 '
<strong><%:Noise%
>:
</strong> %d dBm
<br />' +
48 '
<strong><%:Bit Rate%
>:
</strong> %
.1f MBit/s | ' +
49 '
<strong><%:Country%
>:
</strong> %s',
50 iw.mode, iw.ssid, iw.bssid,
51 iw.encryption ? iw.encryption.description : '<%:None%
>',
52 iw.channel, iw.frequency ? (iw.frequency /
1000) :
0,
53 iw.txpower, iw.signal, iw.noise,
54 iw.bitrate ? (iw.bitrate /
1000) :
0, iw.country
57 d.innerHTML = '<%:Wireless is disabled or not associated%
>';
62 window.setTimeout(arguments.callee,
5000);
67 <tr class=
"cbi-section-table">
69 <td class=
"cbi-value-field" style=
"width:16px; padding:3px" id=
"<%=self.option%>-iw-signal">
70 <img src=
"<%=resource%>/icons/signal-none.png" title=
"<%:Not associated%>" /><br />
73 <td class=
"cbi-value-field" style=
"vertical-align:middle; text-align:left; padding:3px" id=
"<%=self.option%>-iw-description">
74 <em><%:Collecting data...%
></em>