mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 03:56:53 -06:00
19380 call configure on embedded tables
This commit is contained in:
parent
7cd5dc0c84
commit
7672ad74e9
@ -223,6 +223,7 @@ class ObjectChangeView(generic.ObjectView):
|
|||||||
data=related_changes[:50],
|
data=related_changes[:50],
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
related_changes_table.configure(request)
|
||||||
|
|
||||||
objectchanges = ObjectChange.objects.valid_models().restrict(request.user, 'view').filter(
|
objectchanges = ObjectChange.objects.valid_models().restrict(request.user, 'view').filter(
|
||||||
changed_object_type=instance.changed_object_type,
|
changed_object_type=instance.changed_object_type,
|
||||||
|
@ -2793,6 +2793,7 @@ class InterfaceView(generic.ObjectView):
|
|||||||
),
|
),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
vdc_table.configure(request)
|
||||||
|
|
||||||
# Get bridge interfaces
|
# Get bridge interfaces
|
||||||
bridge_interfaces = Interface.objects.restrict(request.user, 'view').filter(bridge=instance)
|
bridge_interfaces = Interface.objects.restrict(request.user, 'view').filter(bridge=instance)
|
||||||
@ -2801,6 +2802,7 @@ class InterfaceView(generic.ObjectView):
|
|||||||
exclude=('device', 'parent'),
|
exclude=('device', 'parent'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
bridge_interfaces_table.configure(request)
|
||||||
|
|
||||||
# Get child interfaces
|
# Get child interfaces
|
||||||
child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance)
|
child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance)
|
||||||
@ -2809,6 +2811,7 @@ class InterfaceView(generic.ObjectView):
|
|||||||
exclude=('device', 'parent'),
|
exclude=('device', 'parent'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
child_interfaces_table.configure(request)
|
||||||
|
|
||||||
# Get assigned VLANs and annotate whether each is tagged or untagged
|
# Get assigned VLANs and annotate whether each is tagged or untagged
|
||||||
vlans = []
|
vlans = []
|
||||||
|
@ -45,10 +45,12 @@ class VRFView(GetRelatedModelsMixin, generic.ObjectView):
|
|||||||
instance.import_targets.all(),
|
instance.import_targets.all(),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
import_targets_table.configure(request)
|
||||||
export_targets_table = tables.RouteTargetTable(
|
export_targets_table = tables.RouteTargetTable(
|
||||||
instance.export_targets.all(),
|
instance.export_targets.all(),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
export_targets_table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'related_models': self.get_related_models(request, instance, omit=[Interface, VMInterface]),
|
'related_models': self.get_related_models(request, instance, omit=[Interface, VMInterface]),
|
||||||
@ -530,6 +532,7 @@ class PrefixView(generic.ObjectView):
|
|||||||
exclude=('vrf', 'utilization'),
|
exclude=('vrf', 'utilization'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
parent_prefix_table.configure(request)
|
||||||
|
|
||||||
# Duplicate prefixes table
|
# Duplicate prefixes table
|
||||||
duplicate_prefixes = Prefix.objects.restrict(request.user, 'view').filter(
|
duplicate_prefixes = Prefix.objects.restrict(request.user, 'view').filter(
|
||||||
@ -544,6 +547,7 @@ class PrefixView(generic.ObjectView):
|
|||||||
exclude=('vrf', 'utilization'),
|
exclude=('vrf', 'utilization'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
duplicate_prefix_table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'aggregate': aggregate,
|
'aggregate': aggregate,
|
||||||
@ -709,6 +713,7 @@ class IPRangeView(generic.ObjectView):
|
|||||||
exclude=('vrf', 'utilization'),
|
exclude=('vrf', 'utilization'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
parent_prefixes_table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'parent_prefixes_table': parent_prefixes_table,
|
'parent_prefixes_table': parent_prefixes_table,
|
||||||
@ -796,6 +801,7 @@ class IPAddressView(generic.ObjectView):
|
|||||||
exclude=('vrf', 'utilization'),
|
exclude=('vrf', 'utilization'),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
parent_prefixes_table.configure(request)
|
||||||
|
|
||||||
# Duplicate IPs table
|
# Duplicate IPs table
|
||||||
duplicate_ips = IPAddress.objects.restrict(request.user, 'view').filter(
|
duplicate_ips = IPAddress.objects.restrict(request.user, 'view').filter(
|
||||||
@ -811,6 +817,7 @@ class IPAddressView(generic.ObjectView):
|
|||||||
duplicate_ips = duplicate_ips.exclude(role=IPAddressRoleChoices.ROLE_ANYCAST)
|
duplicate_ips = duplicate_ips.exclude(role=IPAddressRoleChoices.ROLE_ANYCAST)
|
||||||
# Limit to a maximum of 10 duplicates displayed here
|
# Limit to a maximum of 10 duplicates displayed here
|
||||||
duplicate_ips_table = tables.IPAddressTable(duplicate_ips[:10], orderable=False)
|
duplicate_ips_table = tables.IPAddressTable(duplicate_ips[:10], orderable=False)
|
||||||
|
duplicate_ips_table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'parent_prefixes_table': parent_prefixes_table,
|
'parent_prefixes_table': parent_prefixes_table,
|
||||||
@ -1170,6 +1177,7 @@ class FHRPGroupView(GetRelatedModelsMixin, generic.ObjectView):
|
|||||||
data=FHRPGroupAssignment.objects.restrict(request.user, 'view').filter(group=instance),
|
data=FHRPGroupAssignment.objects.restrict(request.user, 'view').filter(group=instance),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
members_table.configure(request)
|
||||||
members_table.columns.hide('group')
|
members_table.columns.hide('group')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -1289,6 +1297,7 @@ class VLANView(generic.ObjectView):
|
|||||||
'vrf', 'scope', 'role', 'tenant'
|
'vrf', 'scope', 'role', 'tenant'
|
||||||
)
|
)
|
||||||
prefix_table = tables.PrefixTable(list(prefixes), exclude=('vlan', 'utilization'), orderable=False)
|
prefix_table = tables.PrefixTable(list(prefixes), exclude=('vlan', 'utilization'), orderable=False)
|
||||||
|
prefix_table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'prefix_table': prefix_table,
|
'prefix_table': prefix_table,
|
||||||
|
@ -505,6 +505,7 @@ class VMInterfaceView(generic.ObjectView):
|
|||||||
exclude=('virtual_machine',),
|
exclude=('virtual_machine',),
|
||||||
orderable=False
|
orderable=False
|
||||||
)
|
)
|
||||||
|
child_interfaces_tables.configure(request)
|
||||||
|
|
||||||
# Get VLAN translation rules
|
# Get VLAN translation rules
|
||||||
vlan_translation_table = None
|
vlan_translation_table = None
|
||||||
|
Loading…
Reference in New Issue
Block a user