diff --git a/netbox/extras/forms/bulk_edit.py b/netbox/extras/forms/bulk_edit.py index 6891edc5d..7a78dba8b 100644 --- a/netbox/extras/forms/bulk_edit.py +++ b/netbox/extras/forms/bulk_edit.py @@ -321,8 +321,27 @@ class ConfigTemplateBulkEditForm(BulkEditForm): max_length=200, required=False ) + mime_type = forms.CharField( + label=_('MIME type'), + max_length=50, + required=False + ) + file_name = forms.CharField( + label=_('File name'), + required=False + ) + file_extension = forms.CharField( + label=_('File extension'), + max_length=15, + required=False + ) + as_attachment = forms.NullBooleanField( + label=_('As attachment'), + required=False, + widget=BulkEditNullBooleanSelect() + ) - nullable_fields = ('description',) + nullable_fields = ('description', 'mime_type', 'file_name', 'file_extension') class JournalEntryBulkEditForm(BulkEditForm): diff --git a/netbox/extras/forms/bulk_import.py b/netbox/extras/forms/bulk_import.py index fb522bd7b..7c270da4a 100644 --- a/netbox/extras/forms/bulk_import.py +++ b/netbox/extras/forms/bulk_import.py @@ -144,8 +144,8 @@ class ExportTemplateImportForm(CSVModelForm): class Meta: model = ExportTemplate fields = ( - 'name', 'object_types', 'description', 'mime_type', 'file_name', 'file_extension', 'as_attachment', - 'template_code', + 'name', 'object_types', 'description', 'environment_params', 'mime_type', 'file_name', 'file_extension', + 'as_attachment', 'template_code', ) @@ -154,7 +154,8 @@ class ConfigTemplateImportForm(CSVModelForm): class Meta: model = ConfigTemplate fields = ( - 'name', 'description', 'environment_params', 'template_code', 'tags', + 'name', 'description', 'template_code', 'environment_params', 'mime_type', 'file_name', 'file_extension', + 'as_attachment', 'tags', ) diff --git a/netbox/extras/forms/filtersets.py b/netbox/extras/forms/filtersets.py index bd3e879ac..056ca62a5 100644 --- a/netbox/extras/forms/filtersets.py +++ b/netbox/extras/forms/filtersets.py @@ -160,9 +160,9 @@ class CustomLinkFilterForm(SavedFiltersMixin, FilterForm): class ExportTemplateFilterForm(SavedFiltersMixin, FilterForm): fieldsets = ( - FieldSet('q', 'filter_id'), + FieldSet('q', 'filter_id', 'object_type_id'), FieldSet('data_source_id', 'data_file_id', name=_('Data')), - FieldSet('object_type_id', 'mime_type', 'file_name', 'file_extension', 'as_attachment', name=_('Attributes')), + FieldSet('mime_type', 'file_name', 'file_extension', 'as_attachment', name=_('Rendering')), ) data_source_id = DynamicModelMultipleChoiceField( queryset=DataSource.objects.all(), diff --git a/netbox/extras/graphql/filters.py b/netbox/extras/graphql/filters.py index e22bda0ac..1e48c6c49 100644 --- a/netbox/extras/graphql/filters.py +++ b/netbox/extras/graphql/filters.py @@ -104,6 +104,9 @@ class ConfigTemplateFilter(BaseObjectTypeFilterMixin, SyncedDataFilterMixin, Cha environment_params: Annotated['JSONFilter', strawberry.lazy('netbox.graphql.filter_lookups')] | None = ( strawberry_django.filter_field() ) + mime_type: FilterLookup[str] | None = strawberry_django.filter_field() + file_extension: FilterLookup[str] | None = strawberry_django.filter_field() + as_attachment: FilterLookup[bool] | None = strawberry_django.filter_field() @strawberry_django.filter(models.CustomField, lookups=True) @@ -193,6 +196,9 @@ class ExportTemplateFilter(BaseObjectTypeFilterMixin, SyncedDataFilterMixin, Cha name: FilterLookup[str] | None = strawberry_django.filter_field() description: FilterLookup[str] | None = strawberry_django.filter_field() template_code: FilterLookup[str] | None = strawberry_django.filter_field() + environment_params: Annotated['JSONFilter', strawberry.lazy('netbox.graphql.filter_lookups')] | None = ( + strawberry_django.filter_field() + ) mime_type: FilterLookup[str] | None = strawberry_django.filter_field() file_extension: FilterLookup[str] | None = strawberry_django.filter_field() as_attachment: FilterLookup[bool] | None = strawberry_django.filter_field()