diff --git a/netbox/project-static/js/interface_toggles.js b/netbox/project-static/js/interface_toggles.js
index df8ac064b..147373335 100644
--- a/netbox/project-static/js/interface_toggles.js
+++ b/netbox/project-static/js/interface_toggles.js
@@ -2,9 +2,23 @@
$('button.toggle-ips').click(function() {
var selected = $(this).attr('selected');
if (selected) {
- $('#interfaces_table tr.interface:visible + tr.ipaddresses').hide();
+ $('.ipaddresses').hide();
} else {
- $('#interfaces_table tr.interface:visible + tr.ipaddresses').show();
+ $('.ipaddresses').show();
+ }
+ $(this).attr('selected', !selected);
+ $(this).children('span').toggleClass('glyphicon-check glyphicon-unchecked');
+ return false;
+});
+
+
+//Toggle the display of VLANs
+$('button.toggle-vlans').click(function(){
+ var selected = $(this).attr('selected');
+ if (selected) {
+ $('.vlans').hide();
+ } else {
+ $('.vlans').show();
}
$(this).attr('selected', !selected);
$(this).children('span').toggleClass('glyphicon-check glyphicon-unchecked');
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html
index fdb5aec08..e15a0710e 100644
--- a/netbox/templates/dcim/device.html
+++ b/netbox/templates/dcim/device.html
@@ -571,6 +571,11 @@
+{# #}
+{#
@@ -585,8 +590,8 @@
Name |
LAG |
Description |
-
Tagged vlans |
-
Untagged vlan |
+{#
Tagged VLANs | #}
+{#
Untagged VLAN | #}
MTU |
Mode |
Cable |
diff --git a/netbox/templates/dcim/inc/interface.html b/netbox/templates/dcim/inc/interface.html
index e5bbe6d06..d19c6e392 100644
--- a/netbox/templates/dcim/inc/interface.html
+++ b/netbox/templates/dcim/inc/interface.html
@@ -39,21 +39,21 @@
{#Tagged ports#}
-
- {% if iface.tagged_vlans.all %}
- {% for tag in iface.tagged_vlans.all %}
- {{ tag }}
-
- {% endfor %}
- {% endif %}
- |
-
+{#
#}
+{# {% if iface.tagged_vlans.all %}#}
+{# {% for tag in iface.tagged_vlans.all %}#}
+{# {{ tag }}#}
+{# #}
+{# {% endfor %}#}
+{# {% endif %}#}
+{# | #}
+{##}
{#Untagged ports#}
-
- {% if iface.untagged_vlan %}
- {{ iface.untagged_vlan }}
- {% endif %}
- |
+{#
#}
+{# {% if iface.untagged_vlan %}#}
+{# {{ iface.untagged_vlan }}#}
+{# {% endif %}#}
+{# | #}
{# MTU #}
{{ iface.mtu|default:"—" }} |
@@ -201,16 +201,17 @@
+
{% with ipaddresses=iface.ip_addresses.all %}
{% if ipaddresses %}
-
- {# Placeholder #}
+
+{# Placeholder#}
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
- |
+ |
{% endif %}
- {# IP addresses table #}
-
+{# IP addresses table#}
+ |
@@ -224,12 +225,12 @@
{% for ip in iface.ip_addresses.all %}
- {# IP address #}
+{# IP address#}
{{ ip }}
|
- {# Primary/status/role #}
+{# Primary/status/role#}
{% if device.primary_ip4 == ip or device.primary_ip6 == ip %}
Primary
@@ -240,7 +241,7 @@
{% endif %}
|
- {# VRF #}
+{# VRF#}
{% if ip.vrf %}
{{ ip.vrf.name }}
@@ -249,7 +250,7 @@
{% endif %}
|
- {# Description #}
+{# Description#}
{% if ip.description %}
{{ ip.description }}
@@ -258,7 +259,7 @@
{% endif %}
|
- {# Buttons #}
+{# Buttons#}
{% if perms.ipam.change_ipaddress %}
@@ -279,3 +280,114 @@
|
{% endif %}
{% endwith %}
+
+{% if iface.untagged_vlan or iface.tagged_vlans.all %}
+
+ {# Placeholder#}
+ {% if perms.dcim.change_interface or perms.dcim.delete_interface %}
+ |
+ {% endif %}
+
+ {# VLAN table #}
+
+
+
+
+ ID |
+ Tagged |
+ Name |
+ Status |
+ Description |
+ |
+
+
+
+ {# Untagged VLAN #}
+ {% if iface.untagged_vlan %}
+
+ {# VLAN ID #}
+
+ {{ iface.untagged_vlan.id }}
+ |
+ {# VLAN tag status #}
+
+
+
+
+ |
+ {# VLAN name #}
+ {{ iface.untagged_vlan.name }} |
+ {# VLAN status #}
+
+ {{ iface.untagged_vlan.status }}
+ |
+ {# VLAN description #}
+ {{ iface.untagged_vlan.description }} |
+ {# VLAN buttons #}
+
+ {% if perms.ipam.change_vlan %}
+
+
+
+ {% endif %}
+ {% if perms.ipam.delete_ipaddress %}
+
+
+
+ {% endif %}
+ |
+ {% endif %}
+
+
+ {# Tagged VLANs #}
+
+ {% if iface.tagged_vlans.all %}
+ {% for tag in iface.tagged_vlans.all %}
+
+ {# VLAN ID #}
+
+ {{ tag.id }}
+ |
+ {# VLAN tag #}
+
+
+
+
+ |
+ {# VLAN name #}
+ {{ tag.name }} |
+ {# VLAN status #}
+
+ {{ tag.status }}
+ |
+ {# VLAN description #}
+ {{ tag.description }} |
+ {# VLAN buttons #}
+
+ {% if perms.ipam.change_vlan %}
+
+
+
+ {% endif %}
+ {% if perms.ipam.delete_ipaddress %}
+
+
+
+ {% endif %}
+ |
+
+ {% endfor %}
+ {% endif %}
+
+ |
+
+{% endif %}
+
|