diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index 863b39e62..2ab3ce7c8 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -150,6 +150,10 @@ class PathEndpoint(models.Model): # Return the path as a list of three-tuples (A termination, cable, B termination) return list(zip(*[iter(path)] * 3)) + @property + def path(self): + return self._path + @property def connected_endpoint(self): """ diff --git a/netbox/dcim/urls.py b/netbox/dcim/urls.py index 90f6b5ef2..884941c9d 100644 --- a/netbox/dcim/urls.py +++ b/netbox/dcim/urls.py @@ -385,5 +385,6 @@ urlpatterns = [ path('power-feeds//delete/', views.PowerFeedDeleteView.as_view(), name='powerfeed_delete'), path('power-feeds//trace/', views.PathTraceView.as_view(), name='powerfeed_trace', kwargs={'model': PowerFeed}), path('power-feeds//changelog/', ObjectChangeLogView.as_view(), name='powerfeed_changelog', kwargs={'model': PowerFeed}), + path('power-feeds//connect//', views.CableCreateView.as_view(), name='powerfeed_connect', kwargs={'termination_a_type': PowerFeed}), ] diff --git a/netbox/templates/dcim/consoleport.html b/netbox/templates/dcim/consoleport.html index 3f4d7b306..2b79b2b1c 100644 --- a/netbox/templates/dcim/consoleport.html +++ b/netbox/templates/dcim/consoleport.html @@ -44,6 +44,15 @@ {% if instance.cable %} + + + + {% if instance.connected_endpoint %} @@ -65,26 +74,17 @@ + + + + {% endif %} - - - - - - - -
Cable + {{ instance.cable }} + + + +
DeviceDescription {{ instance.connected_endpoint.description|placeholder }}
Path Status + {% if instance.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
Cable - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} - {% else %} - {{ instance.get_connection_status_display }} - {% endif %} -
{% else %}
diff --git a/netbox/templates/dcim/consoleserverport.html b/netbox/templates/dcim/consoleserverport.html index 77d17fe8a..ae164634d 100644 --- a/netbox/templates/dcim/consoleserverport.html +++ b/netbox/templates/dcim/consoleserverport.html @@ -44,6 +44,15 @@
{% if instance.cable %} + + + + {% if instance.connected_endpoint %} @@ -65,26 +74,17 @@ + + + + {% endif %} - - - - - - - -
Cable + {{ instance.cable }} + + + +
DeviceDescription {{ instance.connected_endpoint.description|placeholder }}
Path Status + {% if instance.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
Cable - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} - {% else %} - {{ instance.get_connection_status_display }} - {% endif %} -
{% else %}
diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 12b9918e9..2a3435f33 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -77,6 +77,15 @@
{% if instance.cable %} + + + + {% if instance.connected_endpoint.device %} {% with iface=instance.connected_endpoint %} @@ -149,21 +158,12 @@ {% endwith %} {% endif %} - + - - - - diff --git a/netbox/templates/dcim/powerfeed.html b/netbox/templates/dcim/powerfeed.html index 017a430ee..9f0a45fcd 100644 --- a/netbox/templates/dcim/powerfeed.html +++ b/netbox/templates/dcim/powerfeed.html @@ -123,11 +123,6 @@
Cable + {{ instance.cable }} + + + +
CablePath Status - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} + {% if instance.path.is_active %} + Reachable {% else %} - {{ instance.get_connection_status_display }} + Not Reachable {% endif %}
- {% include 'inc/custom_fields_panel.html' with obj=powerfeed %} - {% include 'extras/inc/tags_panel.html' with tags=powerfeed.tags.all url='dcim:powerfeed_list' %} - {% plugin_left_page powerfeed %} - -
Electrical Characteristics @@ -155,6 +150,70 @@
+ {% include 'inc/custom_fields_panel.html' with obj=powerfeed %} + {% include 'extras/inc/tags_panel.html' with tags=powerfeed.tags.all url='dcim:powerfeed_list' %} + {% plugin_left_page powerfeed %} +
+
+
+
+ Connection +
+ {% if powerfeed.cable %} + + + + + + {% if powerfeed.connected_endpoint %} + + + + + + + + + + + + + + + + + + + + + {% endif %} +
Cable + {{ powerfeed.cable }} + + + +
Device + {{ powerfeed.connected_endpoint.device }} +
Name + {{ powerfeed.connected_endpoint.name }} +
Type{{ powerfeed.connected_endpoint.get_type_display|placeholder }}
Description{{ powerfeed.connected_endpoint.description|placeholder }}
Path Status + {% if powerfeed.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
+ {% else %} +
+ {% if perms.dcim.add_cable %} + + Connect + + {% endif %} + Not connected +
+ {% endif %} +
Comments diff --git a/netbox/templates/dcim/poweroutlet.html b/netbox/templates/dcim/poweroutlet.html index 2ea70972b..82782be09 100644 --- a/netbox/templates/dcim/poweroutlet.html +++ b/netbox/templates/dcim/poweroutlet.html @@ -52,6 +52,15 @@
{% if instance.cable %} + + + + {% if instance.connected_endpoint %} @@ -73,26 +82,17 @@ + + + + {% endif %} - - - - - - - -
Cable + {{ instance.cable }} + + + +
DeviceDescription {{ instance.connected_endpoint.description|placeholder }}
Path Status + {% if instance.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
Cable - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} - {% else %} - {{ instance.get_connection_status_display }} - {% endif %} -
{% else %}
diff --git a/netbox/templates/dcim/powerport.html b/netbox/templates/dcim/powerport.html index 3f3d28899..52c9c0e95 100644 --- a/netbox/templates/dcim/powerport.html +++ b/netbox/templates/dcim/powerport.html @@ -52,6 +52,15 @@
{% if instance.cable %} + + + + {% if instance.connected_endpoint %} @@ -73,26 +82,17 @@ + + + + {% endif %} - - - - - - - -
Cable + {{ instance.cable }} + + + +
DeviceDescription {{ instance.connected_endpoint.description|placeholder }}
Path Status + {% if instance.path.is_active %} + Reachable + {% else %} + Not Reachable + {% endif %} +
Cable - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} - {% else %} - {{ instance.get_connection_status_display }} - {% endif %} -
{% else %}