var rxp = ifc.stats ? ifc.stats["rx_packets"] : 0;
var txp = ifc.stats ? ifc.stats["tx_packets"] : 0;
var mac = ifc.macaddr ? ifc.macaddr : '00:00:00:00:00:00';
+ var upt = '-';
var icon;
if (is_up)
+ {
+ if (ifc.uptime)
+ upt = String.format('%t', ifc.uptime);
+
icon = "<%=resource%>/icons/ethernet.png";
+ }
else
+ {
icon = "<%=resource%>/icons/ethernet_disabled.png";
+ }
var s = document.getElementById(ifc.id + '-ifc-signal');
if (s)
);
}
+ var u = document.getElementById(ifc.id + '-ifc-uptime');
+ if (u)
+ {
+ u.innerHTML = upt;
+ }
+
var m = document.getElementById(ifc.id + '-ifc-mac');
if (m)
{
t.innerHTML = String.format(
'<strong><%:RX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />' +
'<strong><%:TX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />',
- txb, txp, rxb, rxp
+ rxb, rxp, txb, txp
);
}
}
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"> </th>
<th class="cbi-section-table-cell"><%:Interface%></th>
+ <th class="cbi-section-table-cell"><%:Uptime%></th>
<th class="cbi-section-table-cell"><%:MAC%></th>
<th class="cbi-section-table-cell" style="text-align:left"><%:Addresses%></th>
<th class="cbi-section-table-cell" style="text-align:left"><%:Transfer%></th>
<img src="<%=resource%>/icons/ethernet_disabled.png" style="width:16px; height:16px" /><br />
<small>?</small>
</td>
+ <td class="cbi-value-field" id="<%=net%>-ifc-uptime">?</td>
<td class="cbi-value-field" id="<%=net%>-ifc-mac">?</td>
<td class="cbi-value-field" style="text-align:left; padding:3px" id="<%=net%>-ifc-addrs"><em><%:Collecting data...%></em></td>
<td class="cbi-value-field" style="text-align:left; padding:3px" id="<%=net%>-ifc-transfer">
<% end %>
</table>
- <form action="<%=luci.dispatcher.build_url("admin/network/iface_add")%>" method="post">
- <input type="submit" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" />
- </form>
+ <input type="button" class="cbi-button cbi-button-add" value="<%:Add new interface...%>" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/iface_add")%>'" />
</fieldset>
</div>