1 <script type=
"text/javascript">//<![CDATA[
2 function wifirate(bss, rx) {
3 var p = rx ? 'rx_' : 'tx_',
4 s = '%
.1f <%:Mbit/s%
>, %d<%:MHz%
>'
5 .format(bss[p+'rate'] /
1000, bss[p+'mhz']),
6 ht = bss[p+'ht'], vht = bss[p+'vht'],
7 mhz = bss[p+'mhz'], nss = bss[p+'nss'],
8 mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'];
11 if (vht) s += ', VHT-MCS %d'.format(mcs);
12 if (nss) s += ', VHT-NSS %d'.format(nss);
13 if (ht) s += ', MCS %s'.format(mcs);
14 if (sgi) s += ', <%:Short GI%
>';
20 XHR.poll(
5, '<%=url('admin/wireless_assoclist')%
>', null,
23 var tb = document.getElementById('wifi_assoclist_table');
28 st.forEach(function(bss) {
30 var q = (-
1 * (bss.noise - bss.signal)) /
5;
32 icon =
"<%=resource%>/icons/signal-0.png";
34 icon =
"<%=resource%>/icons/signal-0-25.png";
36 icon =
"<%=resource%>/icons/signal-25-50.png";
38 icon =
"<%=resource%>/icons/signal-50-75.png";
40 icon =
"<%=resource%>/icons/signal-75-100.png";
43 '
<span class=
"ifacebadge" title=
"%q"><img src=
"<%=resource%>/icons/wifi.png" /> <a href=
"%s">%h
</a><small> (%h)
</small></span>'.format(
49 bss.host_hint ? '%h (%h)'.format(bss.host_name || '?', bss.host_hint) : (bss.host_name || '?'),
50 '
<span class=
"ifacebadge" title=
"<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%> / <%:SNR%>: %d"><img src=
"%s" /> %d / %d <%:dBm%
></span>'.format(
53 bss.signal - bss.noise,
58 E('span', wifirate(bss, true)),
60 E('span', wifirate(bss, false))
65 cbi_update_table(tb, rows, '
<em><%:No information available%
></em>');
71 <div class=
"table" id=
"wifi_assoclist_table">
72 <div class=
"tr table-titles">
73 <div class=
"th nowrap"><%:Network%
></div>
74 <div class=
"th hide-xs"><%:MAC-Address%
></div>
75 <div class=
"th nowrap"><%:Host%
></div>
76 <div class=
"th nowrap"><%:Signal%
> / <%:Noise%
></div>
77 <div class=
"th nowrap"><%:RX Rate%
> / <%:TX Rate%
></div>
79 <div class=
"tr placeholder">
80 <div class=
"td"><em><%:Collecting data...%
></em></div>