ui: verify job: make namespace and max-depth aware

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-11 09:42:49 +02:00
parent a327f918af
commit ad7741a294
3 changed files with 80 additions and 21 deletions

View File

@ -41,6 +41,7 @@ JSSRC= \
form/RemoteSelector.js \
form/DataStoreSelector.js \
form/NamespaceSelector.js \
form/NamespaceMaxDepth.js \
form/CalendarEvent.js \
form/PermissionPathSelector.js \
form/GroupSelector.js \

View File

@ -0,0 +1,33 @@
Ext.define('PBS.form.NamespaceMaxDepth', {
extend: 'Proxmox.form.field.Integer',
alias: 'widget.pbsNamespaceMaxDepth',
allowBlank: true,
emptyText: gettext('Full'),
fieldLabel: gettext('Max. Depth'),
deleteEmpty: true,
minValue: 0,
maxValue: 7,
triggers: {
clear: {
cls: 'pmx-clear-trigger',
weight: -1,
hidden: true,
handler: function() {
this.triggers.clear.setVisible(false);
this.setValue('');
},
},
},
listeners: {
change: function(field, value) {
let canClear = value !== '';
field.triggers.clear.setVisible(canClear);
},
},
});

View File

@ -31,7 +31,7 @@ Ext.define('PBS.window.VerifyJobEdit', {
viewModel: {
data: {
'ignore-verified': true,
'ignoreVerified': true,
},
},
@ -60,6 +60,23 @@ Ext.define('PBS.window.VerifyJobEdit', {
allowBlank: false,
},
},
{
xtype: 'pbsNamespaceSelector',
name: 'ns',
fieldLabel: gettext('Namespace'),
cbind: {
datastore: '{datastore}',
},
},
{
xtype: 'pbsNamespaceMaxDepth',
name: 'max-depth',
fieldLabel: gettext('Max. Depth'),
deleteEmpty: true,
},
],
column2: [
{
xtype: 'pbsCalendarEvent',
name: 'schedule',
@ -70,35 +87,43 @@ Ext.define('PBS.window.VerifyJobEdit', {
deleteEmpty: '{!isCreate}',
},
},
],
column2: [
{
xtype: 'proxmoxcheckbox',
name: 'ignore-verified',
fieldLabel: gettext('Skip verified snapshots'),
labelWidth: 150,
fieldLabel: gettext('Skip Verified'),
uncheckedValue: false,
value: true,
bind: {
value: '{ignore-verified}',
value: '{ignoreVerified}',
},
},
{
xtype: 'proxmoxintegerfield',
name: 'outdated-after',
fieldLabel: gettext('Re-Verify After (days)'),
labelWidth: 150,
minValue: 1,
value: 30,
allowBlank: true,
emptyText: gettext('Never'),
bind: {
disabled: '{!ignore-verified}',
},
cbind: {
deleteEmpty: '{!isCreate}',
},
xtype: 'fieldcontainer',
layout: 'hbox',
fieldLabel: gettext('Re-Verify After'),
items: [
{
xtype: 'pbsVerifyOutdatedAfter',
name: 'outdated-after',
bind: {
disabled: '{!ignoreVerified}',
},
cbind: {
deleteEmpty: '{!isCreate}',
},
flex: 1,
},
{
xtype: 'displayfield',
padding: '0 0 0 5',
name: 'unit',
submitValue: false,
value: gettext('days'),
bind: {
disabled: '{!ignoreVerified}',
},
},
],
},
],