Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions netbox/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def get(self, request):
'changed_object_type'
)[:20]
changelog_table = ObjectChangeTable(changelog)
changelog_table.configure(request)

return render(request, self.template_name, {
'changelog_table': changelog_table,
Expand Down
1 change: 1 addition & 0 deletions netbox/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def get_extra_context(self, request, instance):
data=related_changes[:50],
orderable=False
)
related_changes_table.configure(request)

objectchanges = ObjectChange.objects.valid_models().restrict(request.user, 'view').filter(
changed_object_type=instance.changed_object_type,
Expand Down
5 changes: 5 additions & 0 deletions netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,7 @@ def get_extra_context(self, request, instance):
),
orderable=False
)
vdc_table.configure(request)

# Get bridge interfaces
bridge_interfaces = Interface.objects.restrict(request.user, 'view').filter(bridge=instance)
Expand All @@ -2801,6 +2802,7 @@ def get_extra_context(self, request, instance):
exclude=('device', 'parent'),
orderable=False
)
bridge_interfaces_table.configure(request)

# Get child interfaces
child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance)
Expand All @@ -2809,6 +2811,7 @@ def get_extra_context(self, request, instance):
exclude=('device', 'parent'),
orderable=False
)
child_interfaces_table.configure(request)

# Get assigned VLANs and annotate whether each is tagged or untagged
vlans = []
Expand All @@ -2823,6 +2826,7 @@ def get_extra_context(self, request, instance):
data=vlans,
orderable=False
)
vlan_table.configure(request)

# Get VLAN translation rules
vlan_translation_table = None
Expand All @@ -2831,6 +2835,7 @@ def get_extra_context(self, request, instance):
data=instance.vlan_translation_policy.rules.all(),
orderable=False
)
vlan_translation_table.configure(request)

return {
'vdc_table': vdc_table,
Expand Down
13 changes: 13 additions & 0 deletions netbox/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ def get_extra_context(self, request, instance):
instance.import_targets.all(),
orderable=False
)
import_targets_table.configure(request)

export_targets_table = tables.RouteTargetTable(
instance.export_targets.all(),
orderable=False
)
export_targets_table.configure(request)

return {
'related_models': self.get_related_models(request, instance, omit=[Interface, VMInterface]),
Expand Down Expand Up @@ -530,6 +533,7 @@ def get_extra_context(self, request, instance):
exclude=('vrf', 'utilization'),
orderable=False
)
parent_prefix_table.configure(request)

# Duplicate prefixes table
duplicate_prefixes = Prefix.objects.restrict(request.user, 'view').filter(
Expand All @@ -544,6 +548,7 @@ def get_extra_context(self, request, instance):
exclude=('vrf', 'utilization'),
orderable=False
)
duplicate_prefix_table.configure(request)

return {
'aggregate': aggregate,
Expand Down Expand Up @@ -709,6 +714,7 @@ def get_extra_context(self, request, instance):
exclude=('vrf', 'utilization'),
orderable=False
)
parent_prefixes_table.configure(request)

return {
'parent_prefixes_table': parent_prefixes_table,
Expand Down Expand Up @@ -796,6 +802,7 @@ def get_extra_context(self, request, instance):
exclude=('vrf', 'utilization'),
orderable=False
)
parent_prefixes_table.configure(request)

# Duplicate IPs table
duplicate_ips = IPAddress.objects.restrict(request.user, 'view').filter(
Expand All @@ -811,6 +818,7 @@ def get_extra_context(self, request, instance):
duplicate_ips = duplicate_ips.exclude(role=IPAddressRoleChoices.ROLE_ANYCAST)
# Limit to a maximum of 10 duplicates displayed here
duplicate_ips_table = tables.IPAddressTable(duplicate_ips[:10], orderable=False)
duplicate_ips_table.configure(request)

return {
'parent_prefixes_table': parent_prefixes_table,
Expand Down Expand Up @@ -888,6 +896,7 @@ def post(self, request):
# Limit to 100 results
addresses = filtersets.IPAddressFilterSet(request.POST, addresses).qs[:100]
table = tables.IPAddressAssignTable(addresses)
table.configure(request)

return render(request, 'ipam/ipaddress_assign.html', {
'form': form,
Expand Down Expand Up @@ -1053,6 +1062,8 @@ def get_extra_context(self, request, instance):
data=instance.rules.all(),
orderable=False
)
vlan_translation_table.configure(request)

return {
'vlan_translation_table': vlan_translation_table,
}
Expand Down Expand Up @@ -1170,6 +1181,7 @@ def get_extra_context(self, request, instance):
data=FHRPGroupAssignment.objects.restrict(request.user, 'view').filter(group=instance),
orderable=False
)
members_table.configure(request)
members_table.columns.hide('group')

return {
Expand Down Expand Up @@ -1289,6 +1301,7 @@ def get_extra_context(self, request, instance):
'vrf', 'scope', 'role', 'tenant'
)
prefix_table = tables.PrefixTable(list(prefixes), exclude=('vlan', 'utilization'), orderable=False)
prefix_table.configure(request)

return {
'prefix_table': prefix_table,
Expand Down
1 change: 1 addition & 0 deletions netbox/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class UserView(generic.ObjectView):
def get_extra_context(self, request, instance):
changelog = ObjectChange.objects.restrict(request.user, 'view').filter(user=instance)[:20]
changelog_table = ObjectChangeTable(changelog)
changelog_table.configure(request)

return {
'changelog_table': changelog_table,
Expand Down
4 changes: 4 additions & 0 deletions netbox/virtualization/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def post(self, request, pk):

selected_objects = Device.objects.filter(pk__in=form.initial['pk'])
device_table = DeviceTable(list(selected_objects), orderable=False)
device_table.configure(request)

return render(request, self.template_name, {
'form': form,
Expand Down Expand Up @@ -505,6 +506,7 @@ def get_extra_context(self, request, instance):
exclude=('virtual_machine',),
orderable=False
)
child_interfaces_tables.configure(request)

# Get VLAN translation rules
vlan_translation_table = None
Expand All @@ -513,6 +515,7 @@ def get_extra_context(self, request, instance):
data=instance.vlan_translation_policy.rules.all(),
orderable=False
)
vlan_translation_table.configure(request)

# Get assigned VLANs and annotate whether each is tagged or untagged
vlans = []
Expand All @@ -527,6 +530,7 @@ def get_extra_context(self, request, instance):
data=vlans,
orderable=False
)
vlan_table.configure(request)

return {
'child_interfaces_table': child_interfaces_tables,
Expand Down
2 changes: 2 additions & 0 deletions netbox/vpn/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,12 @@ def get_extra_context(self, request, instance):
instance.import_targets.prefetch_related('tenant'),
orderable=False
)
import_targets_table.configure(request)
export_targets_table = RouteTargetTable(
instance.export_targets.prefetch_related('tenant'),
orderable=False
)
export_targets_table.configure(request)

return {
'import_targets_table': import_targets_table,
Expand Down