[pbs-devel] [PATCH proxmox-backup 5/6] ui: sync job: don't send delete value on creation

Dominik Csapak d.csapak at proxmox.com
Wed Mar 6 12:21:03 CET 2024


since that's not a valid api parameter there
we have to pass the `isCreate` value through to the inputpanel, we even
used it there already but it was never set.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/window/SyncJobEdit.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index c11103eb..e06fdd81 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -80,6 +80,9 @@ Ext.define('PBS.window.SyncJobEdit', {
 		    }
 		    return values;
 		},
+		cbind: {
+		    isCreate: '{isCreate}', // pass it through
+		},
 		column1: [
 		    {
 			xtype: 'pmxDisplayEditField',
@@ -266,7 +269,9 @@ Ext.define('PBS.window.SyncJobEdit', {
 			xtype: 'pbsNamespaceMaxDepthReduced',
 			name: 'max-depth',
 			fieldLabel: gettext('Max. Depth'),
-			deleteEmpty: true,
+			cbind: {
+			    deleteEmpty: '{!isCreate}',
+			},
 		    },
 		    {
 			fieldLabel: gettext('Remove vanished'),
@@ -321,6 +326,7 @@ Ext.define('PBS.window.SyncJobEdit', {
 	    {
 		xtype: 'inputpanel',
 		onGetValues: function(values) {
+		    let me = this;
 		    PBS.Utils.delete_if_default(values, 'group-filter');
 		    if (Ext.isArray(values['group-filter'])) {
 			if (values['group-filter'].length === 0) {
@@ -331,8 +337,14 @@ Ext.define('PBS.window.SyncJobEdit', {
 			    values['group-filter'] = [...new Set(values['group-filter'])];
 			}
 		    }
+		    if (me.isCreate) {
+			delete values.delete;
+		    }
 		    return values;
 		},
+		cbind: {
+		    isCreate: '{isCreate}', // pass it through
+		},
 		title: gettext('Group Filter'),
 		items: [
 		    {
-- 
2.39.2





More information about the pbs-devel mailing list