mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 13:38:16 -06:00
Extend filterset forms
This commit is contained in:
parent
0066eed445
commit
bf11f1db0d
@ -225,21 +225,24 @@ class SavedFilterFilterForm(SavedFiltersMixin, FilterForm):
|
||||
|
||||
class WebhookFilterForm(NetBoxModelFilterSetForm):
|
||||
model = Webhook
|
||||
tag = TagFilterField(model)
|
||||
fieldsets = (
|
||||
(None, ('q', 'filter_id', 'tag')),
|
||||
(_('Attributes'), ('payload_url', 'http_method', 'http_content_type')),
|
||||
)
|
||||
http_content_type = forms.CharField(
|
||||
label=_('HTTP content type'),
|
||||
required=False
|
||||
)
|
||||
payload_url = forms.CharField(
|
||||
label=_('Payload URL'),
|
||||
required=False
|
||||
)
|
||||
|
||||
fieldsets = (
|
||||
(None, ('q', 'filter_id', 'tag')),
|
||||
(_('Attributes'), ('payload_url', 'http_method',)),
|
||||
)
|
||||
http_method = forms.MultipleChoiceField(
|
||||
choices=WebhookHttpMethodChoices,
|
||||
required=False,
|
||||
label=_('HTTP method')
|
||||
)
|
||||
tag = TagFilterField(model)
|
||||
|
||||
|
||||
class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
||||
@ -248,7 +251,7 @@ class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
||||
|
||||
fieldsets = (
|
||||
(None, ('q', 'filter_id', 'tag')),
|
||||
(_('Attributes'), ('content_type_id', 'enabled')),
|
||||
(_('Attributes'), ('content_type_id', 'action_type', 'enabled')),
|
||||
(_('Events'), ('type_create', 'type_update', 'type_delete', 'type_job_start', 'type_job_end')),
|
||||
)
|
||||
content_type_id = ContentTypeMultipleChoiceField(
|
||||
@ -256,6 +259,11 @@ class EventRuleFilterForm(NetBoxModelFilterSetForm):
|
||||
required=False,
|
||||
label=_('Object type')
|
||||
)
|
||||
action_type = forms.ChoiceField(
|
||||
choices=add_blank_choice(EventRuleActionChoices),
|
||||
required=False,
|
||||
label=_('Action type')
|
||||
)
|
||||
enabled = forms.NullBooleanField(
|
||||
label=_('Enabled'),
|
||||
required=False,
|
||||
|
Loading…
Reference in New Issue
Block a user