add oob ip to device view and device edit view

This commit is contained in:
Jamie Murphy 2023-06-26 22:30:49 +01:00
parent b45606d6ba
commit 077e5c465e
2 changed files with 32 additions and 0 deletions

View File

@ -220,6 +220,36 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">OOB IPv4</th>
<td>
{% if object.oob_ip4 %}
<a href="{{ object.oob_ip4.get_absolute_url }}">{{ object.oob_ip4.address.ip }}</a>
{% if object.oob_ip4.nat_inside %}
(NAT for <a href="{{ object.oob_ip4.nat_inside.get_absolute_url }}">{{ object.oob_ip4.nat_inside.address.ip }}</a>)
{% elif object.oob_ip4.nat_outside.exists %}
(NAT: {% for nat in object.oob_ip4.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">OOB IPv6</th>
<td>
{% if object.oob_ip6 %}
<a href="{{ object.oob_ip6.get_absolute_url }}">{{ object.oob_ip6.address.ip }}</a>
{% if object.oob_ip6.nat_inside %}
(NAT for <a href="{{ object.oob_ip6.nat_inside.get_absolute_url }}">{{ object.oob_ip6.nat_inside.address.ip }}</a>)
{% elif object.oob_ip6.nat_outside.exists %}
(NAT: {% for nat in object.oob_ip6.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
{% if object.cluster %}
<tr>
<th>Cluster</th>

View File

@ -66,6 +66,8 @@
{% if object.pk %}
{% render_field form.primary_ip4 %}
{% render_field form.primary_ip6 %}
{% render_field form.oob_ip4 %}
{% render_field form.oob_ip6 %}
{% endif %}
</div>