mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #3668: search address by DNS name when assigning
This commit is contained in:
parent
770f4c962c
commit
1cdbfd6d60
@ -4,6 +4,7 @@
|
||||
|
||||
* [#2050](https://github.com/netbox-community/netbox/issues/2050) - Preview image attachments when hovering the link
|
||||
* [#3187](https://github.com/netbox-community/netbox/issues/3187) - Add rack selection field to rack elevations
|
||||
* [#3668](https://github.com/netbox-community/netbox/issues/3668) - Search by DNS name when assigning IP address
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
|
@ -943,7 +943,12 @@ class IPAddressAssignForm(BootstrapMixin, forms.Form):
|
||||
)
|
||||
)
|
||||
address = forms.CharField(
|
||||
label='IP Address'
|
||||
label='IP Address',
|
||||
required=False,
|
||||
)
|
||||
dns_name = forms.CharField(
|
||||
label='DNS Name',
|
||||
required=False,
|
||||
)
|
||||
|
||||
|
||||
|
@ -373,7 +373,7 @@ class IPAddressAssignTable(BaseTable):
|
||||
|
||||
class Meta(BaseTable.Meta):
|
||||
model = IPAddress
|
||||
fields = ('address', 'vrf', 'status', 'role', 'tenant', 'parent', 'interface', 'description')
|
||||
fields = ('address', 'dns_name', 'vrf', 'status', 'role', 'tenant', 'parent', 'interface', 'description')
|
||||
orderable = False
|
||||
|
||||
|
||||
|
@ -745,6 +745,7 @@ class IPAddressAssignView(PermissionRequiredMixin, View):
|
||||
).filter(
|
||||
vrf=form.cleaned_data['vrf'],
|
||||
address__istartswith=form.cleaned_data['address'],
|
||||
dns_name__icontains=form.cleaned_data['dns_name'],
|
||||
)[:100] # Limit to 100 results
|
||||
table = tables.IPAddressAssignTable(queryset)
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
<div class="panel-body">
|
||||
{% render_field form.vrf %}
|
||||
{% render_field form.address %}
|
||||
{% render_field form.dns_name %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user