mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #6121: Extend parent interface assignment to VM interfaces
This commit is contained in:
@ -421,6 +421,14 @@ class VMInterfaceView(generic.ObjectView):
|
||||
orderable=False
|
||||
)
|
||||
|
||||
# Get child interfaces
|
||||
child_interfaces = VMInterface.objects.restrict(request.user, 'view').filter(parent=instance)
|
||||
child_interfaces_tables = tables.VMInterfaceTable(
|
||||
child_interfaces,
|
||||
orderable=False
|
||||
)
|
||||
child_interfaces_tables.columns.hide('virtual_machine')
|
||||
|
||||
# Get assigned VLANs and annotate whether each is tagged or untagged
|
||||
vlans = []
|
||||
if instance.untagged_vlan is not None:
|
||||
@ -437,6 +445,7 @@ class VMInterfaceView(generic.ObjectView):
|
||||
|
||||
return {
|
||||
'ipaddress_table': ipaddress_table,
|
||||
'child_interfaces_table': child_interfaces_tables,
|
||||
'vlan_table': vlan_table,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user