From 5aa2a6eefe022593ddc334f9902aaf101fa927c6 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 25 Jun 2020 13:27:01 -0400 Subject: [PATCH] Add plugin buttons & content to device component views --- netbox/templates/dcim/consoleport.html | 8 + netbox/templates/dcim/consoleserverport.html | 8 + netbox/templates/dcim/device_component.html | 2 + netbox/templates/dcim/devicebay.html | 8 + netbox/templates/dcim/frontport.html | 8 + netbox/templates/dcim/interface.html | 420 ++++++++++--------- netbox/templates/dcim/poweroutlet.html | 8 + netbox/templates/dcim/powerport.html | 8 + netbox/templates/dcim/rearport.html | 8 + 9 files changed, 272 insertions(+), 206 deletions(-) diff --git a/netbox/templates/dcim/consoleport.html b/netbox/templates/dcim/consoleport.html index f1f2c4c1c..63916bcc5 100644 --- a/netbox/templates/dcim/consoleport.html +++ b/netbox/templates/dcim/consoleport.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -34,6 +35,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -90,6 +92,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/consoleserverport.html b/netbox/templates/dcim/consoleserverport.html index 8d7ca0b43..cdc43142e 100644 --- a/netbox/templates/dcim/consoleserverport.html +++ b/netbox/templates/dcim/consoleserverport.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -34,6 +35,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -90,6 +92,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/device_component.html b/netbox/templates/dcim/device_component.html index d2a1ad660..616655066 100644 --- a/netbox/templates/dcim/device_component.html +++ b/netbox/templates/dcim/device_component.html @@ -1,6 +1,7 @@ {% extends 'base.html' %} {% load helpers %} {% load perms %} +{% load plugins %} {% block header %}
@@ -14,6 +15,7 @@
+ {% plugin_buttons instance %} {% if request.user|can_change:instance %} Edit diff --git a/netbox/templates/dcim/devicebay.html b/netbox/templates/dcim/devicebay.html index b257cd471..3d65e8bde 100644 --- a/netbox/templates/dcim/devicebay.html +++ b/netbox/templates/dcim/devicebay.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -30,6 +31,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -57,6 +59,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/frontport.html b/netbox/templates/dcim/frontport.html index 33ce03eb8..8ab51cb30 100644 --- a/netbox/templates/dcim/frontport.html +++ b/netbox/templates/dcim/frontport.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -44,6 +45,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -78,6 +80,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index b3163c413..4c0b453ad 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -1,219 +1,227 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %} -
-
-
-
- Interface -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Device - {{ instance.device }} -
Name{{ instance.name }}
Label{{ instance.label|placeholder }}
Type{{ instance.get_type_display }}
Enabled - {% if instance.enabled %} - - {% else %} - - {% endif %} -
LAG - {% if instance.lag%} - {{ instance.lag }} - {% else %} - None - {% endif %} -
Description{{ instance.description|placeholder }}
MTU{{ instance.mtu|placeholder }}
MAC Address{{ instance.mac_address|placeholder }}
802.1Q Mode{{ instance.get_mode_display }}
-
- {% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} -
-
- {% if instance.is_connectable %} +
+
- Connection + Interface
- {% if instance.cable %} - - {% if connected_interface %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% elif connected_circuittermination %} - {% with ct=connected_circuittermination %} - - - - - - - - - - - - - {% endwith %} - {% endif %} - - - - - - - - -
Device - {{ connected_interface.device }} -
Name - {{ connected_interface.name }} -
Type{{ connected_interface.get_type_display }}
Enabled - {% if connected_interface.enabled %} - - {% else %} - - {% endif %} -
LAG - {% if connected_interface.lag%} - {{ connected_interface.lag }} - {% else %} - None - {% endif %} -
Description{{ connected_interface.description|placeholder }}
MTU{{ connected_interface.mtu|placeholder }}
MAC Address{{ connected_interface.mac_address|placeholder }}
802.1Q Mode{{ connected_interface.get_mode_display }}
Provider{{ ct.circuit.provider }}
Circuit{{ ct.circuit }}
Side{{ ct.term_side }}
Cable - {{ instance.cable }} - - - -
Connection Status - {% if instance.connection_status %} - {{ instance.get_connection_status_display }} - {% else %} - {{ instance.get_connection_status_display }} - {% endif %} -
- {% else %} -
- Not connected -
- {% endif %} -
- {% endif %} - {% if instance.is_lag %} -
-
LAG Members
- - - - - - - - - - {% for member in instance.member_interfaces.all %} - - - - - - {% empty %} - - - - {% endfor %} - +
ParentInterfaceType
- {{ member.device }} - - {{ member }} - - {{ member.get_type_display }} -
No member interfaces
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Device + {{ instance.device }} +
Name{{ instance.name }}
Label{{ instance.label|placeholder }}
Type{{ instance.get_type_display }}
Enabled + {% if instance.enabled %} + + {% else %} + + {% endif %} +
LAG + {% if instance.lag%} + {{ instance.lag }} + {% else %} + None + {% endif %} +
Description{{ instance.description|placeholder }}
MTU{{ instance.mtu|placeholder }}
MAC Address{{ instance.mac_address|placeholder }}
802.1Q Mode{{ instance.get_mode_display }}
- {% endif %} + {% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %} +
+
+ {% if instance.is_connectable %} +
+
+ Connection +
+ {% if instance.cable %} + + {% if connected_interface %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% elif connected_circuittermination %} + {% with ct=connected_circuittermination %} + + + + + + + + + + + + + {% endwith %} + {% endif %} + + + + + + + + +
Device + {{ connected_interface.device }} +
Name + {{ connected_interface.name }} +
Type{{ connected_interface.get_type_display }}
Enabled + {% if connected_interface.enabled %} + + {% else %} + + {% endif %} +
LAG + {% if connected_interface.lag%} + {{ connected_interface.lag }} + {% else %} + None + {% endif %} +
Description{{ connected_interface.description|placeholder }}
MTU{{ connected_interface.mtu|placeholder }}
MAC Address{{ connected_interface.mac_address|placeholder }}
802.1Q Mode{{ connected_interface.get_mode_display }}
Provider{{ ct.circuit.provider }}
Circuit{{ ct.circuit }}
Side{{ ct.term_side }}
Cable + {{ instance.cable }} + + + +
Connection Status + {% if instance.connection_status %} + {{ instance.get_connection_status_display }} + {% else %} + {{ instance.get_connection_status_display }} + {% endif %} +
+ {% else %} +
+ Not connected +
+ {% endif %} +
+ {% endif %} + {% if instance.is_lag %} +
+
LAG Members
+ + + + + + + + + + {% for member in instance.member_interfaces.all %} + + + + + + {% empty %} + + + + {% endfor %} + +
ParentInterfaceType
+ {{ member.device }} + + {{ member }} + + {{ member.get_type_display }} +
No member interfaces
+
+ {% endif %} + {% plugin_right_page device %} +
-
-
-
- {% include 'panel_table.html' with table=ipaddress_table heading="IP Addresses" %} +
+
+ {% include 'panel_table.html' with table=ipaddress_table heading="IP Addresses" %} +
-
-
-
- {% include 'panel_table.html' with table=vlan_table heading="VLANs" %} +
+
+ {% include 'panel_table.html' with table=vlan_table heading="VLANs" %} +
+
+
+
+ {% plugin_full_width_page instance %} +
-
{% endblock %} diff --git a/netbox/templates/dcim/poweroutlet.html b/netbox/templates/dcim/poweroutlet.html index 519bd01df..cddcffd6f 100644 --- a/netbox/templates/dcim/poweroutlet.html +++ b/netbox/templates/dcim/poweroutlet.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -42,6 +43,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -98,6 +100,12 @@
{% endif %}
+ {% plugin_right_page instance %} +
+
+
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/powerport.html b/netbox/templates/dcim/powerport.html index e7c103c9d..8642bd8fb 100644 --- a/netbox/templates/dcim/powerport.html +++ b/netbox/templates/dcim/powerport.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -42,6 +43,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -98,6 +100,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %} diff --git a/netbox/templates/dcim/rearport.html b/netbox/templates/dcim/rearport.html index 480f26d2c..982d53eaa 100644 --- a/netbox/templates/dcim/rearport.html +++ b/netbox/templates/dcim/rearport.html @@ -1,5 +1,6 @@ {% extends 'dcim/device_component.html' %} {% load helpers %} +{% load plugins %} {% block content %}
@@ -38,6 +39,7 @@
{% include 'extras/inc/tags_panel.html' with tags=instance.tags.all %} + {% plugin_left_page instance %}
@@ -72,6 +74,12 @@
{% endif %}
+ {% plugin_right_page instance %} + + +
+
+ {% plugin_full_width_page instance %}
{% endblock %}