mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Merge 11216b3cc2
into c6f3b00f0e
This commit is contained in:
commit
c6375358e5
@ -202,7 +202,7 @@ class PrefixFilter(CustomFieldFilterSet, django_filters.FilterSet):
|
|||||||
return queryset
|
return queryset
|
||||||
try:
|
try:
|
||||||
query = str(IPNetwork(value).cidr)
|
query = str(IPNetwork(value).cidr)
|
||||||
return queryset.filter(prefix__net_contained_or_equal=query)
|
return queryset.filter(prefix__net_contained=query)
|
||||||
except (AddrFormatError, ValueError):
|
except (AddrFormatError, ValueError):
|
||||||
return queryset.none()
|
return queryset.none()
|
||||||
|
|
||||||
|
@ -492,6 +492,7 @@ class PrefixView(View):
|
|||||||
'site', 'vlan', 'role',
|
'site', 'vlan', 'role',
|
||||||
).annotate_depth(limit=0)
|
).annotate_depth(limit=0)
|
||||||
if child_prefixes:
|
if child_prefixes:
|
||||||
|
child_prefix_count = len(child_prefixes)
|
||||||
child_prefixes = add_available_prefixes(prefix.prefix, child_prefixes)
|
child_prefixes = add_available_prefixes(prefix.prefix, child_prefixes)
|
||||||
child_prefix_table = tables.PrefixDetailTable(child_prefixes)
|
child_prefix_table = tables.PrefixDetailTable(child_prefixes)
|
||||||
if request.user.has_perm('ipam.change_prefix') or request.user.has_perm('ipam.delete_prefix'):
|
if request.user.has_perm('ipam.change_prefix') or request.user.has_perm('ipam.delete_prefix'):
|
||||||
@ -520,6 +521,8 @@ class PrefixView(View):
|
|||||||
'bulk_querystring': 'vrf_id={}&within={}'.format(prefix.vrf or '0', prefix.prefix),
|
'bulk_querystring': 'vrf_id={}&within={}'.format(prefix.vrf or '0', prefix.prefix),
|
||||||
'permissions': permissions,
|
'permissions': permissions,
|
||||||
'return_url': prefix.get_absolute_url(),
|
'return_url': prefix.get_absolute_url(),
|
||||||
|
'bulk_querystring': 'parent={}'.format(prefix.prefix),
|
||||||
|
'obj_num': child_prefix_count,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="checkbox-inline">
|
<div class="checkbox-inline">
|
||||||
<label for="select_all">
|
<label for="select_all">
|
||||||
<input type="checkbox" id="select_all" name="_all" />
|
<input type="checkbox" id="select_all" name="_all" />
|
||||||
Select <strong>all {{ table.rows|length }} {{ table.data.verbose_name_plural }}</strong> matching query
|
Select <strong>all {% if obj_num %}{{ obj_num }}{% else %}{{ table.rows|length }}{% endif %} {{ table.data.verbose_name_plural }}</strong> matching query
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
|
Loading…
Reference in New Issue
Block a user