1 <script type="text/javascript">//<![CDATA[
2 var switches = [ '<%=table.concat(self.switches, "', '")%>' ];
3 XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "switch_status")%>/' + switches.join(','), null,
6 for (var i = 0; i < switches.length; i++)
8 var ports = st[switches[i]];
9 var th0 = document.getElementById('portstatus-' + switches[i]);
11 if (th0 && ports && ports.length)
14 th0.innerHTML = '<%:Port status:%>';
16 for (var j = 0; j < ports.length; j++)
18 var th = th0.parentNode.parentNode.childNodes[j+1];
22 th.innerHTML = String.format(
23 '<small><img src="<%=resource%>/icons/port_up.png" />' +
24 '<br />%d<%:baseT%><br />%s</small>',
25 ports[j].speed, ports[j].duplex
26 ? '<%:full-duplex%>' : '<%:half-duplex%>'
31 th.innerHTML = String.format(
32 '<small><img src="<%=resource%>/icons/port_down.png" />' +
33 '<br /><%:no link%></small>'