3 <script type="text/javascript">//<![CDATA[
5 var update_status = function() {
6 iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null,
9 if (iw && (iw = iw[0]))
11 var is_assoc = (iw.bssid && iw.channel);
12 var p = (100 / iw.quality_max * iw.quality);
13 var q = is_assoc ? p : -1;
17 icon = "<%=resource%>/icons/signal-none.png";
19 icon = "<%=resource%>/icons/signal-0.png";
21 icon = "<%=resource%>/icons/signal-0-25.png";
23 icon = "<%=resource%>/icons/signal-25-50.png";
25 icon = "<%=resource%>/icons/signal-50-75.png";
27 icon = "<%=resource%>/icons/signal-75-100.png";
29 var s = document.getElementById('<%=self.option%>-iw-signal');
31 s.innerHTML = String.format(
32 '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" /><br />' +
33 '<small>%d%%</small>', icon, iw.signal, iw.noise, p
36 var d = document.getElementById('<%=self.option%>-iw-description');
38 d.innerHTML = String.format(
39 '<strong><%:Mode%>:</strong> %s | ' +
40 '<strong><%:SSID%>:</strong> %h<br />' +
41 '<strong><%:BSSID%>:</strong> %s | ' +
42 '<strong><%:Encryption%>:</strong> %s<br />' +
43 '<strong><%:Channel%>:</strong> %d (%.3f GHz) | ' +
44 '<strong><%:Tx-Power%>:</strong> %d dBm<br />' +
45 '<strong><%:Signal%>:</strong> %d dBm | ' +
46 '<strong><%:Noise%>:</strong> %d dBm<br />' +
47 '<strong><%:Bit Rate%>:</strong> %.1f MBit/s | ' +
48 '<strong><%:Country%>:</strong> %s',
49 iw.mode, iw.ssid, iw.bssid,
50 iw.encryption ? iw.encryption.description : '<%:None%>',
51 iw.channel, iw.frequency ? (iw.frequency / 1000) : 0,
52 iw.txpower, iw.signal, iw.noise,
53 iw.bitrate ? (iw.bitrate / 1000) : 0, iw.country
56 d.innerHTML = String.format(
57 '<strong><%:SSID%>:</strong> %h | ' +
58 '<strong><%:Mode%>:</strong> %s<br />' +
59 '<em><%:Wireless is disabled or not associated%></em>',
60 iw.ssid || '?', iw.mode
64 window.setTimeout(update_status, 5000);
73 <tr class="cbi-section-table">
75 <td class="cbi-value-field" style="width:16px; padding:3px" id="<%=self.option%>-iw-signal">
76 <img src="<%=resource%>/icons/signal-none.png" title="<%:Not associated%>" /><br />
79 <td class="cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px" id="<%=self.option%>-iw-description">
80 <em><%:Collecting data...%></em>