mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 08:08:15 -06:00
Created InterfaceListFilterForm and added more search terms. Remove export on device page. Fix enabled column
This commit is contained in:
parent
04ea5bdebb
commit
62281cb1aa
@ -1571,6 +1571,17 @@ class InterfaceFilterForm(BootstrapMixin, forms.Form):
|
||||
device = forms.CharField(required=False, label='Device name')
|
||||
|
||||
|
||||
class InterfaceListFilterForm(BootstrapMixin, forms.Form):
|
||||
site = forms.ModelChoiceField(required=False, queryset=Site.objects.all(), to_field_name='slug')
|
||||
device = forms.ModelChoiceField(required=False, queryset=Device.objects.all(), to_field_name='slug')
|
||||
enabled = form.ModelChoiceField(choices=((INTERFACE_ENABLED,'Enabled'),(INTERFACE_DISABLED,'Disabled')),required=False)
|
||||
role = FilterChoiceField(
|
||||
queryset=DeviceRole.objects.annotate(filter_count=Count('devices')),
|
||||
to_field_name='slug',
|
||||
)
|
||||
mac_address = forms.CharField(required=False, label='MAC address')
|
||||
|
||||
|
||||
#
|
||||
# Interface connections
|
||||
#
|
||||
|
@ -104,7 +104,7 @@ DEVICE_STATUS = """
|
||||
"""
|
||||
|
||||
INTERFACE_ENABLED = """
|
||||
<span class="label label-{{ record.get_status_class }}">{{ record.is_enabled }}</span>
|
||||
<span class="label label-{{ record.get_status_class }}">{{ record.enabled }}</span>
|
||||
"""
|
||||
|
||||
DEVICE_PRIMARY_IP = """
|
||||
|
@ -1558,7 +1558,7 @@ class InterfaceBulkImportView(PermissionRequiredMixin, BulkImportView):
|
||||
class InterfaceListView(ObjectListView):
|
||||
queryset = Interface.objects.all()
|
||||
filter = filters.InterfaceFilter
|
||||
filter_form = forms.InterfaceFilterForm
|
||||
filter_form = forms.InterfaceListFilterForm
|
||||
table = tables.InterfaceListTable
|
||||
template_name = 'dcim/interface_list.html'
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
Import Interfaces
|
||||
</a>
|
||||
{% endif %}
|
||||
{% include 'inc/export_button.html' with obj_type='interfaces' %}
|
||||
</div>
|
||||
<h1>Interfaces</h1>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user