From eef5cefb5d8a8c5f60a015c09f0051a76b0d12ca Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 3 Oct 2022 16:11:24 -0400 Subject: [PATCH] Fixes #10460: Restore missing connection details for device components --- docs/release-notes/version-3.3.md | 1 + netbox/templates/dcim/consoleport.html | 104 ++++++------------ netbox/templates/dcim/consoleserverport.html | 104 ++++++------------ .../templates/dcim/inc/cabletermination.html | 14 --- .../dcim/inc/connection_endpoints.html | 36 ++++++ netbox/templates/dcim/interface.html | 86 +-------------- netbox/templates/dcim/powerfeed.html | 88 ++++----------- netbox/templates/dcim/poweroutlet.html | 82 ++++---------- netbox/templates/dcim/powerport.html | 102 ++++++----------- 9 files changed, 178 insertions(+), 439 deletions(-) delete mode 100644 netbox/templates/dcim/inc/cabletermination.html create mode 100644 netbox/templates/dcim/inc/connection_endpoints.html diff --git a/docs/release-notes/version-3.3.md b/docs/release-notes/version-3.3.md index 6d2bb3b5c..4b7b76270 100644 --- a/docs/release-notes/version-3.3.md +++ b/docs/release-notes/version-3.3.md @@ -15,6 +15,7 @@ * [#10435](https://github.com/netbox-community/netbox/issues/10435) - Fix exception when filtering VLANs by virtual machine with no cluster assigned * [#10439](https://github.com/netbox-community/netbox/issues/10439) - Fix form widget styling for DeviceType airflow field * [#10445](https://github.com/netbox-community/netbox/issues/10445) - Avoid rounding virtual machine memory values +* [#10460](https://github.com/netbox-community/netbox/issues/10460) - Restore missing connection details for device components * [#10461](https://github.com/netbox-community/netbox/issues/10461) - Enable filtering by read-only custom fields in the UI * [#10470](https://github.com/netbox-community/netbox/issues/10470) - Omit read-only custom fields from CSV import forms * [#10480](https://github.com/netbox-community/netbox/issues/10480) - Cable trace SVG links should not force a new window diff --git a/netbox/templates/dcim/consoleport.html b/netbox/templates/dcim/consoleport.html index 39ffbf552..ad4f15c9d 100644 --- a/netbox/templates/dcim/consoleport.html +++ b/netbox/templates/dcim/consoleport.html @@ -54,80 +54,40 @@ {% plugin_left_page object %}
-
-
- Connection -
-
- {% if object.mark_connected %} - Marked as connected - {% elif object.cable %} - - - - - - {% if object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device{{ object.connected_endpoint.device|linkify }}
Name{{ object.connected_endpoint|linkify:"name" }}
Type{{ object.connected_endpoint.get_type_display|placeholder }}
Description{{ object.connected_endpoint.description|placeholder }}
Path Status - {% if object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
- {% else %} -
- Not Connected - {% if perms.dcim.add_cable %} - - {% endif %} -
- {% endif %} +
+
Connection
+
+ {% if object.mark_connected %} + Marked as connected + {% elif object.cable %} + {% include 'dcim/inc/connection_endpoints.html' %} + {% else %} +
+ Not Connected + {% if perms.dcim.add_cable %} + + {% endif %}
+ {% endif %}
- {% include 'dcim/inc/panels/inventory_items.html' %} - {% plugin_right_page object %} +
+ {% include 'dcim/inc/panels/inventory_items.html' %} + {% plugin_right_page object %}
diff --git a/netbox/templates/dcim/consoleserverport.html b/netbox/templates/dcim/consoleserverport.html index 642e758a3..a543cd5ff 100644 --- a/netbox/templates/dcim/consoleserverport.html +++ b/netbox/templates/dcim/consoleserverport.html @@ -54,82 +54,40 @@ {% plugin_left_page object %}
-
-
- Connection -
-
- {% if object.mark_connected %} - Marked as connected - {% elif object.cable %} - - - - - - {% if object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device - {{ object.connected_endpoint.device|linkify }} -
Name{{ object.connected_endpoint|linkify:"name" }}
Type{{ object.connected_endpoint.get_type_display|placeholder }}
Description{{ object.connected_endpoint.description|placeholder }}
Path Status - {% if object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
- {% else %} -
- Not Connected - {% if perms.dcim.add_cable %} - - {% endif %} +
+
Connection
+
+ {% if object.mark_connected %} + Marked as connected + {% elif object.cable %} + {% include 'dcim/inc/connection_endpoints.html' %} + {% else %} +
+ Not Connected + {% if perms.dcim.add_cable %} + - {% endif %} + {% endif %}
+ {% endif %}
- {% include 'dcim/inc/panels/inventory_items.html' %} - {% plugin_right_page object %} +
+ {% include 'dcim/inc/panels/inventory_items.html' %} + {% plugin_right_page object %}
diff --git a/netbox/templates/dcim/inc/cabletermination.html b/netbox/templates/dcim/inc/cabletermination.html deleted file mode 100644 index c7fa7918a..000000000 --- a/netbox/templates/dcim/inc/cabletermination.html +++ /dev/null @@ -1,14 +0,0 @@ - - {% if termination.parent_object.provider %} - - - {{ termination.parent_object.provider }} - {{ termination.parent_object }} - - {% else %} - {{ termination.parent_object|linkify }} - {% endif %} - - - {{ termination|linkify }} - diff --git a/netbox/templates/dcim/inc/connection_endpoints.html b/netbox/templates/dcim/inc/connection_endpoints.html new file mode 100644 index 000000000..fb994a492 --- /dev/null +++ b/netbox/templates/dcim/inc/connection_endpoints.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + +
Cable + {{ object.cable|linkify }} + + + +
Path Status + {% if object.path.is_complete and object.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
Path Endpoints + {% for endpoint in object.connected_endpoints %} + {% if endpoint.parent_object %} + {{ endpoint.parent_object|linkify }} + + {% endif %} + {{ endpoint|linkify }} + {% if not forloop.last %}
{% endif %} + {% empty %} + {{ ''|placeholder }} + {% endfor %} +
diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 1216f3e88..887433d7b 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -144,89 +144,7 @@ Marked as Connected
{% elif object.cable %} - - {% if object.connected_endpoint.device %} - - - - {% endif %} - - - - - {% if object.connected_endpoint.device %} - {% with iface=object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% endwith %} - {% elif object.connected_endpoint.circuit %} - {% with ct=object.connected_endpoint %} - - - - - - - - - - - - - {% endwith %} - {% endif %} - - - - -
- {% if object.connected_endpoint.enabled %} - Enabled - {% else %} - Disabled - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device{{ iface.device|linkify }}
Name{{ iface|linkify:"name" }}
Type{{ iface.get_type_display }}
LAG{{ iface.lag|linkify|placeholder }}
Description{{ iface.description|placeholder }}
MTU{{ iface.mtu|placeholder }}
MAC Address{{ iface.mac_address|placeholder }}
802.1Q Mode{{ iface.get_mode_display }}
Provider{{ ct.circuit.provider|linkify }}
Circuit{{ ct.circuit|linkify }}
Side{{ ct.term_side }}
Path Status - {% if object.path.is_complete and object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
+ {% include 'dcim/inc/connection_endpoints.html' %} {% elif object.wireless_link %} @@ -238,7 +156,7 @@ - {% with peer_interface=object.connected_endpoint %} + {% with peer_interface=object.link_peers.0 %} diff --git a/netbox/templates/dcim/powerfeed.html b/netbox/templates/dcim/powerfeed.html index 584454df8..adb779ce3 100644 --- a/netbox/templates/dcim/powerfeed.html +++ b/netbox/templates/dcim/powerfeed.html @@ -100,73 +100,33 @@ {% plugin_left_page object %}
-
-
- Connection -
-
- {% if object.mark_connected %} -
- Marked as connected -
- {% elif object.cable %} -
Device {{ peer_interface.device|linkify }}
- - - - - {% if object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device{{ object.connected_endpoint.device|linkify }}
Name{{ object.connected_endpoint|linkify:"name" }}
Type{{ object.connected_endpoint.get_type_display|placeholder }}
Description{{ object.connected_endpoint.description|placeholder }}
Path Status - {% if object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
- {% else %} -
- Not connected -
- {% endif %} +
+
Connection
+
+ {% if object.mark_connected %} +
+ Marked as connected
- {% if not object.mark_connected and not object.cable %} - - {% include 'inc/panels/comments.html' %} - {% plugin_right_page object %} + {% if not object.mark_connected and not object.cable %} + + {% endif %} +
+ {% include 'inc/panels/comments.html' %} + {% plugin_right_page object %}
diff --git a/netbox/templates/dcim/poweroutlet.html b/netbox/templates/dcim/poweroutlet.html index 26f4a07f8..fb6de8ddb 100644 --- a/netbox/templates/dcim/poweroutlet.html +++ b/netbox/templates/dcim/poweroutlet.html @@ -58,69 +58,29 @@ {% plugin_left_page object %}
-
-
- Connection -
-
- {% if object.mark_connected %} -
- Marked as Connected -
- {% elif object.cable %} - - - - - - {% if object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device{{ object.connected_endpoint.device|linkify }}
Name{{ object.connected_endpoint|linkify:"name" }}
Type{{ object.connected_endpoint.get_type_display|placeholder }}
Description{{ object.connected_endpoint.description|placeholder }}
Path Status - {% if object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
- {% else %} -
- Not Connected - {% if perms.dcim.add_cable %} - - Connect - - {% endif %} -
- {% endif %} +
+
Connection
+
+ {% if object.mark_connected %} +
+ Marked as Connected
+ {% elif object.cable %} + {% include 'dcim/inc/connection_endpoints.html' %} + {% else %} +
+ Not Connected + {% if perms.dcim.add_cable %} + + Connect + + {% endif %} +
+ {% endif %}
- {% include 'dcim/inc/panels/inventory_items.html' %} - {% plugin_right_page object %} +
+ {% include 'dcim/inc/panels/inventory_items.html' %} + {% plugin_right_page object %}
diff --git a/netbox/templates/dcim/powerport.html b/netbox/templates/dcim/powerport.html index c5eccbf14..c552c2398 100644 --- a/netbox/templates/dcim/powerport.html +++ b/netbox/templates/dcim/powerport.html @@ -58,79 +58,39 @@ {% plugin_left_page object %}
-
-
- Connection -
-
- {% if object.mark_connected %} -
- Marked as Connected -
- {% elif object.cable %} - - - - - - {% if object.connected_endpoint %} - - - - - - - - - - - - - - - - - - - - - {% endif %} -
Cable - {{ object.cable|linkify }} - - - -
Device{{ object.connected_endpoint.device|linkify }}
Name{{ object.connected_endpoint|linkify:"name" }}
Type{{ object.connected_endpoint.get_type_display|placeholder }}
Description{{ object.connected_endpoint.description|placeholder }}
Path Status - {% if object.path.is_active %} - Reachable - {% else %} - Not Reachable - {% endif %} -
- {% else %} -
- Not Connected - {% if perms.dcim.add_cable %} - - - - - {% endif %} -
- {% endif %} +
+
Connection
+
+ {% if object.mark_connected %} +
+ Marked as Connected
+ {% elif object.cable %} + {% include 'dcim/inc/connection_endpoints.html' %} + {% else %} +
+ Not Connected + {% if perms.dcim.add_cable %} + + + + + {% endif %} +
+ {% endif %}
- {% include 'dcim/inc/panels/inventory_items.html' %} - {% plugin_right_page object %} +
+ {% include 'dcim/inc/panels/inventory_items.html' %} + {% plugin_right_page object %}