]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: sync job: don't send delete value on creation
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 6 Mar 2024 11:21:03 +0000 (12:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 Mar 2024 09:30:40 +0000 (10:30 +0100)
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@proxmox.com>
www/window/SyncJobEdit.js

index c11103eba8cc64c6d6bdb528d40281e8e137dc04..e06fdd81ac407e21b69fe71fecf7636efd6173cf 100644 (file)
@@ -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: [
                    {