mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-11 10:59:36 -06:00
Merge pull request #20855 from ifoughal/20822-add-auto_sync_enabled-property-for-configtemplates
Fixes 20822: add auto sync enabled property for configtemplates
This commit is contained in:
commit
3e0ad2176f
@ -23,6 +23,6 @@ class ConfigTemplateSerializer(ChangeLogMessageSerializer, TaggableModelSerializ
|
|||||||
fields = [
|
fields = [
|
||||||
'id', 'url', 'display_url', 'display', 'name', 'description', 'environment_params', 'template_code',
|
'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',
|
'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')
|
brief_fields = ('id', 'url', 'display', 'name', 'description')
|
||||||
|
|||||||
@ -398,8 +398,12 @@ class ConfigTemplateBulkEditForm(ChangelogMessageMixin, BulkEditForm):
|
|||||||
required=False,
|
required=False,
|
||||||
widget=BulkEditNullBooleanSelect()
|
widget=BulkEditNullBooleanSelect()
|
||||||
)
|
)
|
||||||
|
auto_sync_enabled = forms.NullBooleanField(
|
||||||
nullable_fields = ('description', 'mime_type', 'file_name', 'file_extension')
|
label=_('Auto sync enabled'),
|
||||||
|
required=False,
|
||||||
|
widget=BulkEditNullBooleanSelect()
|
||||||
|
)
|
||||||
|
nullable_fields = ('description', 'mime_type', 'file_name', 'file_extension', 'auto_sync_enabled',)
|
||||||
|
|
||||||
|
|
||||||
class ImageAttachmentBulkEditForm(ChangelogMessageMixin, BulkEditForm):
|
class ImageAttachmentBulkEditForm(ChangelogMessageMixin, BulkEditForm):
|
||||||
|
|||||||
@ -479,7 +479,7 @@ class ConfigTemplateFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
model = ConfigTemplate
|
model = ConfigTemplate
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
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'))
|
FieldSet('mime_type', 'file_name', 'file_extension', 'as_attachment', name=_('Rendering'))
|
||||||
)
|
)
|
||||||
data_source_id = DynamicModelMultipleChoiceField(
|
data_source_id = DynamicModelMultipleChoiceField(
|
||||||
@ -495,6 +495,13 @@ class ConfigTemplateFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
'source_id': '$data_source_id'
|
'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)
|
tag = TagFilterField(ConfigTemplate)
|
||||||
mime_type = forms.CharField(
|
mime_type = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
|
|||||||
@ -632,6 +632,10 @@ class ConfigTemplateTable(NetBoxTable):
|
|||||||
orderable=False,
|
orderable=False,
|
||||||
verbose_name=_('Synced')
|
verbose_name=_('Synced')
|
||||||
)
|
)
|
||||||
|
auto_sync_enabled = columns.BooleanColumn(
|
||||||
|
verbose_name=_('Auto Sync Enabled'),
|
||||||
|
orderable=False,
|
||||||
|
)
|
||||||
mime_type = tables.Column(
|
mime_type = tables.Column(
|
||||||
verbose_name=_('MIME Type')
|
verbose_name=_('MIME Type')
|
||||||
)
|
)
|
||||||
|
|||||||
@ -62,6 +62,10 @@
|
|||||||
<th scope="row">{% trans "Data Synced" %}</th>
|
<th scope="row">{% trans "Data Synced" %}</th>
|
||||||
<td>{{ object.data_synced|placeholder }}</td>
|
<td>{{ object.data_synced|placeholder }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{% trans "Auto Sync Enabled" %}</th>
|
||||||
|
<td>{% checkmark object.auto_sync_enabled %}</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% include 'inc/panels/tags.html' %}
|
{% include 'inc/panels/tags.html' %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user