Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netbox/extras/api/serializers_/configtemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ class Meta:
fields = [
'id', 'url', 'display_url', 'display', 'name', 'description', 'environment_params', 'template_code',
'mime_type', 'file_name', 'file_extension', 'as_attachment', 'data_source', 'data_path', 'data_file',
'data_synced', 'tags', 'created', 'last_updated',
'auto_sync_enabled', 'data_synced', 'tags', 'created', 'last_updated',
]
brief_fields = ('id', 'url', 'display', 'name', 'description')
8 changes: 6 additions & 2 deletions netbox/extras/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,12 @@ class ConfigTemplateBulkEditForm(ChangelogMessageMixin, BulkEditForm):
required=False,
widget=BulkEditNullBooleanSelect()
)

nullable_fields = ('description', 'mime_type', 'file_name', 'file_extension')
auto_sync_enabled = forms.NullBooleanField(
label=_('Auto sync enabled'),
required=False,
widget=BulkEditNullBooleanSelect()
)
nullable_fields = ('description', 'mime_type', 'file_name', 'file_extension', 'auto_sync_enabled',)


class ImageAttachmentBulkEditForm(ChangelogMessageMixin, BulkEditForm):
Expand Down
9 changes: 8 additions & 1 deletion netbox/extras/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ class ConfigTemplateFilterForm(SavedFiltersMixin, FilterForm):
model = ConfigTemplate
fieldsets = (
FieldSet('q', 'filter_id', 'tag'),
FieldSet('data_source_id', 'data_file_id', name=_('Data')),
FieldSet('data_source_id', 'data_file_id', 'auto_sync_enabled', name=_('Data')),
FieldSet('mime_type', 'file_name', 'file_extension', 'as_attachment', name=_('Rendering'))
)
data_source_id = DynamicModelMultipleChoiceField(
Expand All @@ -492,6 +492,13 @@ class ConfigTemplateFilterForm(SavedFiltersMixin, FilterForm):
'source_id': '$data_source_id'
}
)
auto_sync_enabled = forms.NullBooleanField(
label=_('Auto sync enabled'),
required=False,
widget=forms.Select(
choices=BOOLEAN_WITH_BLANK_CHOICES
)
)
tag = TagFilterField(ConfigTemplate)
mime_type = forms.CharField(
required=False,
Expand Down
4 changes: 4 additions & 0 deletions netbox/extras/tables/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ class ConfigTemplateTable(NetBoxTable):
orderable=False,
verbose_name=_('Synced')
)
auto_sync_enabled = columns.BooleanColumn(
verbose_name=_('Auto Sync Enabled'),
orderable=False,
)
mime_type = tables.Column(
verbose_name=_('MIME Type')
)
Expand Down
4 changes: 4 additions & 0 deletions netbox/templates/extras/configtemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ <h2 class="card-header">{% trans "Config Template" %}</h2>
<th scope="row">{% trans "Data Synced" %}</th>
<td>{{ object.data_synced|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Auto Sync Enabled" %}</th>
<td>{% checkmark object.auto_sync_enabled %}</td>
</tr>
</table>
</div>
{% include 'inc/panels/tags.html' %}
Expand Down
Loading