Просмотр исходного кода

Fixes #10108: Linkify inside NAT IPs for primary device IPs in UI

jeremystretch 3 лет назад
Родитель
Сommit
984d8b8ee6

+ 2 - 0
docs/release-notes/version-3.3.md

@@ -12,9 +12,11 @@
 
 * [#10040](https://github.com/netbox-community/netbox/issues/10040) - Fix exception when ordering prefixes by flat representation
 * [#10053](https://github.com/netbox-community/netbox/issues/10053) - Custom fields header should not be displayed when editing circuit terminations with no custom fields
+* [#10055](https://github.com/netbox-community/netbox/issues/10055) - Fix extraneous NAT indicator by device primary IP
 * [#10057](https://github.com/netbox-community/netbox/issues/10057) - Fix AttributeError exception when global search results include rack reservations
 * [#10059](https://github.com/netbox-community/netbox/issues/10059) - Add identifier column to L2VPN table
 * [#10089](https://github.com/netbox-community/netbox/issues/10089) - `linkify` template filter should escape object representation
+* [#10108](https://github.com/netbox-community/netbox/issues/10108) - Linkify inside NAT IPs for primary device IPs in UI
 
 ---
 

+ 3 - 5
netbox/templates/dcim/device.html

@@ -155,9 +155,7 @@
         </div>
         <div class="col col-md-6">
             <div class="card">
-                <h5 class="card-header">
-                    Management
-                </h5>
+                <h5 class="card-header">Management</h5>
                 <div class="card-body">
                     <table class="table table-hover attr-table">
                         <tr>
@@ -178,7 +176,7 @@
                               {% if object.primary_ip4 %}
                                 <a href="{{ object.primary_ip4.get_absolute_url }}">{{ object.primary_ip4.address.ip }}</a>
                                 {% if object.primary_ip4.nat_inside %}
-                                  (NAT for {{ object.primary_ip4.nat_inside.address.ip|linkify }})
+                                  (NAT for <a href="{{ object.primary_ip4.nat_inside.get_absolute_url }}">{{ object.primary_ip4.nat_inside.address.ip }}</a>)
                                 {% elif object.primary_ip4.nat_outside.exists %}
                                   (NAT for {% for nat in object.primary_ip4.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
                                 {% endif %}
@@ -193,7 +191,7 @@
                               {% if object.primary_ip6 %}
                                 <a href="{{ object.primary_ip6.get_absolute_url }}">{{ object.primary_ip6.address.ip }}</a>
                                 {% if object.primary_ip6.nat_inside %}
-                                  (NAT for {{ object.primary_ip6.nat_inside.address.ip|linkify }})
+                                  (NAT for <a href="{{ object.primary_ip6.nat_inside.get_absolute_url }}">{{ object.primary_ip6.nat_inside.address.ip }}</a>)
                                 {% elif object.primary_ip6.nat_outside.exists %}
                                   (NAT for {% for nat in object.primary_ip6.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
                                 {% endif %}

+ 3 - 3
netbox/templates/ipam/ipaddress.html

@@ -95,9 +95,9 @@
                       <td>
                         {% for ip in object.nat_outside.all %}
                           {{ ip|linkify }}
-                            {% if ip.assigned_object %}
-                              ({{ ip.assigned_object.parent_object|linkify }})
-                            {% endif %}<br/>
+                          {% if ip.assigned_object %}
+                            ({{ ip.assigned_object.parent_object|linkify }})
+                          {% endif %}<br/>
                         {% empty %}
                           {{ ''|placeholder }}
                         {% endfor %}