Show ipv4 and ipv6 addresses
This commit is contained in:
parent
18b65f892e
commit
688b90f3f6
|
@ -285,6 +285,10 @@ def parse_nodewatcher_xml(xml):
|
|||
}
|
||||
if len(netif.xpath("ipv6_link_local_addr/text()")) > 0:
|
||||
interface["ipv6_fe80_addr"] = netif.xpath("ipv6_link_local_addr/text()")[0].lower().split("/")[0]
|
||||
if len(netif.xpath("ipv6_addr/text()")) > 0:
|
||||
interface["ipv6_addrs"] = []
|
||||
for ipv6_addr in netif.xpath("ipv6_addr/text()"):
|
||||
interface["ipv6_addrs"].append(ipv6_addr.lower().split("/")[0])
|
||||
if len(netif.xpath("ipv4_addr/text()")) > 0:
|
||||
interface["ipv4_addr"] = netif.xpath("ipv4_addr/text()")[0]
|
||||
router_update["netifs"].append(interface)
|
||||
|
|
|
@ -228,6 +228,12 @@
|
|||
{%- else -%}
|
||||
<em title="Calculated from MAC Address">{{ netif.mac|mac2fe80 }}</em>
|
||||
{%- endif -%}
|
||||
{%- if netif.ipv4_addr -%}
|
||||
<br />{{ netif.ipv4_addr }}
|
||||
{%- endif -%}
|
||||
{%- for ipv6_addr in netif.ipv6_addrs %}
|
||||
<br />{{ ipv6_addr }}
|
||||
{%- endfor %}
|
||||
</div>
|
||||
{%- if netif.traffic.rx is defined %}
|
||||
<div class="col-xs-7 col-sm-7 text-right">
|
||||
|
@ -251,6 +257,12 @@
|
|||
{%- else -%}
|
||||
<em title="Calculated from MAC Address">{{ netif.mac|mac2fe80 }}</em>
|
||||
{%- endif -%}
|
||||
{%- if netif.ipv4_addr -%}
|
||||
<br />{{ netif.ipv4_addr }}
|
||||
{%- endif -%}
|
||||
{%- for ipv6_addr in netif.ipv6_addrs %}
|
||||
<br />{{ ipv6_addr }}
|
||||
{%- endfor %}
|
||||
</div>
|
||||
{%- if netif.traffic.rx is defined %}
|
||||
<div class="col-xs-7 col-sm-7 text-right">
|
||||
|
|
Loading…
Reference in New Issue