3 <script type=
"text/javascript"><![CDATA[
6 iwxhr.get('<%=luci.dispatcher.build_url(
"admin",
"network",
"iface_status", self.network)%
>', null,
9 var ifc = x.responseText ? eval('(' + x.responseText + ')') : { };
10 if (ifc && (ifc = ifc[
0]))
12 var is_up = (ifc.flags && ifc.flags.up);
13 var rxb = ifc.stats ? (ifc.stats[
"rx_bytes"] /
1024) :
0;
14 var txb = ifc.stats ? (ifc.stats[
"tx_bytes"] /
1024) :
0;
15 var rxp = ifc.stats ? ifc.stats[
"rx_packets"] :
0;
16 var txp = ifc.stats ? ifc.stats[
"tx_packets"] :
0;
17 var mac = ifc.macaddr ? ifc.macaddr : '
00:
00:
00:
00:
00:
00';
21 icon =
"<%=resource%>/icons/ethernet.png";
23 icon =
"<%=resource%>/icons/ethernet_disabled.png";
25 var s = document.getElementById('<%=self.option%
>-ifc-signal');
27 s.innerHTML = String.format(
28 '
<img src=
"%s" style=
"width:16px; height:16px" /><br />' +
29 '
<small>%s
</small>', icon, ifc.ifname ? ifc.ifname : '?'
32 var d = document.getElementById('<%=self.option%
>-ifc-description');
35 d.innerHTML = String.format(
36 '
<strong><%:MAC Address%
>:
</strong> %s
<br />' +
37 '
<strong><%:RX%
></strong>: %
.2f <%:KB%
> (%d <%:Pkts.%
>)
<br />' +
38 '
<strong><%:TX%
></strong>: %
.2f <%:KB%
> (%d <%:Pkts.%
>)
<br />',
39 mac, rxb, rxp, txb, txp
42 if (ifc.ipaddrs && ifc.ipaddrs.length)
44 d.innerHTML += '
<strong><%:IPv4%
>:
</strong>';
46 for (var i =
0; i < ifc.ipaddrs.length; i++)
47 d.innerHTML += String.format(
54 d.innerHTML += '
<br />';
57 if (ifc.ip6addrs && ifc.ip6addrs.length)
59 d.innerHTML += '
<strong><%:IPv6%
>:
</strong>';
61 for (var i =
0; i < ifc.ip6addrs.length; i++)
62 d.innerHTML += String.format(
66 ifc.ip6addrs[i].prefix
69 d.innerHTML += '
<br />';
73 d.innerHTML = '<%:Interface not present or not connected yet.%
>';
78 window.setTimeout(arguments.callee,
5000);
83 <tr class=
"cbi-section-table">
85 <td class=
"cbi-value-field" style=
"width:16px; padding:3px; text-align:center" id=
"<%=self.option%>-ifc-signal">
86 <img src=
"<%=resource%>/icons/ethernet_disabled.png" style=
"width:16px; height:16px" /><br />
89 <td class=
"cbi-value-field" style=
"vertical-align:middle; text-align:left; padding:3px" id=
"<%=self.option%>-ifc-description">
90 <em><%:Collecting data...%
></em>