1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add child interfaces table to interface view

This commit is contained in:
jeremystretch
2021-04-02 17:33:34 -04:00
parent f28edd0864
commit 72a115b434
2 changed files with 25 additions and 0 deletions

View File

@@ -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'
}