3 <script type="text/javascript">//<![CDATA[
7 var func = arguments.callee;
9 iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "iface_status", self.network)%>', null,
12 if (ifc && (ifc = ifc[0]))
16 var s = document.getElementById('<%=self.option%>-ifc-signal');
18 s.innerHTML = String.format(
19 '<img src="<%=resource%>/icons/%s%s.png" style="width:16px; height:16px" />' +
20 '<br /><small>%s</small>',
21 ifc.type, ifc.is_up ? '' : '_disabled',
25 var d = document.getElementById('<%=self.option%>-ifc-description');
26 if (d && ifc.ifname && ifc.macaddr != '00:00:00:00:00:00')
30 html += String.format('<strong><%:Uptime%>:</strong> %t<br />', ifc.uptime);
33 if (ifc.type != 'tunnel')
35 html += String.format('<strong><%:MAC Address%>:</strong> %s<br />', ifc.macaddr);
38 html += String.format(
39 '<strong><%:RX%></strong>: %.2mB (%d <%:Pkts.%>)<br />' +
40 '<strong><%:TX%></strong>: %.2mB (%d <%:Pkts.%>)<br />',
41 ifc.rx_bytes, ifc.rx_packets,
42 ifc.tx_bytes, ifc.tx_packets
45 if (ifc.ipaddrs && ifc.ipaddrs.length)
47 html += '<strong><%:IPv4%>: </strong>';
49 for (var i = 0; i < ifc.ipaddrs.length; i++)
50 html += String.format(
60 if (ifc.ip6addrs && ifc.ip6addrs.length)
62 html += '<strong><%:IPv6%>: </strong>';
64 for (var i = 0; i < ifc.ip6addrs.length; i++)
65 html += String.format(
68 ifc.ip6addrs[i].addr.toUpperCase(),
69 ifc.ip6addrs[i].prefix
79 d.innerHTML = '<em><%:Interface not present or not connected yet.%></em>';
83 window.setTimeout(func, 5000);
90 <tr class="cbi-section-table">
92 <td class="cbi-value-field" style="min-width:16px; padding:3px; text-align:center" id="<%=self.option%>-ifc-signal">
93 <img src="<%=resource%>/icons/ethernet_disabled.png" style="width:16px; height:16px" /><br />
96 <td class="cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px" id="<%=self.option%>-ifc-description">
97 <em><%:Collecting data...%></em>