The Overview page and Network>Interfaces page currently do not give much information about IPv6, particularly with Prefix Delegated setups. In these setups, ISP will delegate a prefix to the router. Currently LuCI doesn't display this Prefix Delegation from the ISP anywhere. A number of changes was added to this commit: 1) self:_ubus("ipv6-prefix") was extracted and put into protocol.ip6prefix. 2) Network>Interfaces page, if a .ip6prefix is present, show it under Status. (IPv6-PD). 3) On the Overview page, "Type" and "Prefix Delegated" has been added to the IPv6 Network Overview Status: - Type will display the .proto, similar to the IPv4 case. If a .ip6prefix is present, it'll display a "-pd" at the end of the Type: i.e. dhcpv6-pd vs. dhcpv6. - If no .ip6prefix is present, it'll do what it does currently, and just show Address, or :: if no address is present. - If .ip6prefix is present, it'll show the "Prefix Delegated", it'll also hide "Address" if no address is present, else it'll show ifc6.ip6addr as well. Signed-off-by: Cody R. Brown <dev@codybrown.ca>
87 lines
2.3 KiB
HTML
87 lines
2.3 KiB
HTML
<%+cbi/valueheader%>
|
|
|
|
<script type="text/javascript">//<![CDATA[
|
|
XHR.poll(5, '<%=url('admin/network/iface_status', self.network)%>', null,
|
|
function(x, ifc)
|
|
{
|
|
if (ifc && (ifc = ifc[0]))
|
|
{
|
|
var html = '';
|
|
|
|
var s = document.getElementById('<%=self.option%>-ifc-signal');
|
|
if (s)
|
|
s.innerHTML = String.format(
|
|
'<img src="<%=resource%>/icons/%s%s.png" style="width:16px; height:16px" />' +
|
|
'<br /><small>%s</small>',
|
|
ifc.type, ifc.is_up ? '' : '_disabled',
|
|
ifc.name
|
|
);
|
|
|
|
var d = document.getElementById('<%=self.option%>-ifc-description');
|
|
if (d && ifc.ifname)
|
|
{
|
|
if (ifc.is_up)
|
|
{
|
|
html += String.format('<strong><%:Uptime%>:</strong> %t<br />', ifc.uptime);
|
|
}
|
|
|
|
if (ifc.macaddr)
|
|
{
|
|
html += String.format('<strong><%:MAC-Address%>:</strong> %s<br />', ifc.macaddr);
|
|
}
|
|
|
|
html += String.format(
|
|
'<strong><%:RX%></strong>: %.2mB (%d <%:Pkts.%>)<br />' +
|
|
'<strong><%:TX%></strong>: %.2mB (%d <%:Pkts.%>)<br />',
|
|
ifc.rx_bytes, ifc.rx_packets,
|
|
ifc.tx_bytes, ifc.tx_packets
|
|
);
|
|
|
|
if (ifc.ipaddrs && ifc.ipaddrs.length)
|
|
{
|
|
for (var i = 0; i < ifc.ipaddrs.length; i++)
|
|
html += String.format(
|
|
'<strong><%:IPv4%>:</strong> %s<br />',
|
|
ifc.ipaddrs[i]
|
|
);
|
|
}
|
|
|
|
if (ifc.ip6addrs && ifc.ip6addrs.length)
|
|
{
|
|
for (var i = 0; i < ifc.ip6addrs.length; i++)
|
|
html += String.format(
|
|
'<strong><%:IPv6%>:</strong> %s<br />',
|
|
ifc.ip6addrs[i]
|
|
);
|
|
}
|
|
|
|
if (ifc.ip6prefix)
|
|
{
|
|
html += String.format('<strong><%:IPv6-PD%>:</strong> %s<br />', ifc.ip6prefix);
|
|
}
|
|
|
|
d.innerHTML = html;
|
|
}
|
|
else if (d)
|
|
{
|
|
d.innerHTML = '<em><%:Interface not present or not connected yet.%></em>';
|
|
}
|
|
}
|
|
}
|
|
);
|
|
//]]></script>
|
|
|
|
<table>
|
|
<tr class="cbi-section-table">
|
|
<td></td>
|
|
<td class="cbi-value-field" style="min-width:16px; padding:3px; text-align:center" id="<%=self.option%>-ifc-signal">
|
|
<img src="<%=resource%>/icons/ethernet_disabled.png" style="width:16px; height:16px" /><br />
|
|
<small>?</small>
|
|
</td>
|
|
<td class="cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px" id="<%=self.option%>-ifc-description">
|
|
<em><%:Collecting data...%></em>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<%+cbi/valuefooter%>
|