diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 8d253f825..171d0702e 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -1847,6 +1847,14 @@ class InterfaceView(generic.ObjectView): orderable=False ) + # Get child interfaces + child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance) + child_interfaces_tables = tables.InterfaceTable( + child_interfaces, + orderable=False + ) + child_interfaces_tables.columns.hide('device') + # Get assigned VLANs and annotate whether each is tagged or untagged vlans = [] if instance.untagged_vlan is not None: @@ -1863,6 +1871,7 @@ class InterfaceView(generic.ObjectView): return { 'ipaddress_table': ipaddress_table, + 'child_interfaces_table': child_interfaces_tables, 'vlan_table': vlan_table, 'breadcrumb_url': 'dcim:device_interfaces' } diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html index 8dc8c07a2..b85dafb4b 100644 --- a/netbox/templates/dcim/interface.html +++ b/netbox/templates/dcim/interface.html @@ -3,6 +3,15 @@ {% load plugins %} {% load render_table from django_tables2 %} +{% block buttons %} + {% if perms.dcim.add_interface and not object.is_virtual %} + + Add Child Interface + + {% endif %} + {{ block.super }} +{% endblock %} + {% block content %}