3 <script type=
"text/javascript">//<![CDATA[
4 XHR.poll(
5, '<%=url('admin/network/iface_status', self.network)%
>', null,
7 if (ifc && (ifc = ifc[
0]))
9 var s = document.getElementById('<%=self.option%
>-ifc-status'),
10 img = s.querySelector('img'),
11 info = s.querySelector('span'),
12 html = '
<strong><%:Device%
>:
</strong> %h
<br />'.format(ifc.ifname);
17 html += String.format('
<strong><%:Uptime%
>:
</strong> %t
<br />', ifc.uptime);
20 html += String.format('
<strong><%:MAC%
>:
</strong> %s
<br />', ifc.macaddr);
22 html += String.format(
23 '
<strong><%:RX%
></strong>: %
.2mB (%d <%:Pkts.%
>)
<br />' +
24 '
<strong><%:TX%
></strong>: %
.2mB (%d <%:Pkts.%
>)
<br />',
25 ifc.rx_bytes, ifc.rx_packets,
26 ifc.tx_bytes, ifc.tx_packets
29 if (ifc.ipaddrs && ifc.ipaddrs.length)
30 for (var i =
0; i < ifc.ipaddrs.length; i++)
31 html += String.format(
32 '
<strong><%:IPv4%
>:
</strong> %s
<br />',
36 if (ifc.ip6addrs && ifc.ip6addrs.length)
37 for (var i =
0; i < ifc.ip6addrs.length; i++)
38 html += String.format(
39 '
<strong><%:IPv6%
>:
</strong> %s
<br />',
44 html += String.format('
<strong><%:IPv6-PD%
>:
</strong> %s
<br />', ifc.ip6prefix);
46 info.innerHTML = html;
50 info.innerHTML = '
<em><%:Interface not present or not connected yet.%
></em>';
53 img.src = '<%=resource%
>/icons/%s%s.png'.format(ifc.type, ifc.is_up ? '' : '_disabled');
59 <span class=
"ifacebadge large" id=
"<%=self.option%>-ifc-status">
60 <img src=
"<%=resource%>/icons/ethernet_disabled.png" />
62 <em><%:Collecting data...%
></em>