]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: backup job editor: fix disable behavior for fleecing storage
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 23 Apr 2024 12:15:00 +0000 (14:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 13:15:34 +0000 (15:15 +0200)
commit 569b0388 (ui: fix reset behavior of backup job editor) disabled
the fleecing storage field by default (as that is the default state)
to fix the reset behavior. This broke editing the job when fleecing
was enabled and the user did not navigate to the advanced tab yet.

It seems that the 'bind' here only gets triggered once the panel is
rendered, but we actually need it before that.

To work around the issue for now, manually enable/disable the field
when toggling the fleecing checkbox. (Though this warrants a bit of
deeper investigation into this bind behavior)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/panel/BackupAdvancedOptions.js

index f1810637989d885f938644eef04f6f47a7b033ad..650946fe9c021f4ebf4a2eb147f7f12af0b339c7 100644 (file)
@@ -18,6 +18,17 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 
     controller: {
        xclass: 'Ext.app.ViewController',
+
+       toggleFleecing: function(cb, value) {
+           let me = this;
+           me.lookup('fleecingStorage').setDisabled(!value);
+       },
+
+       control: {
+           'proxmoxcheckbox[reference=fleecingEnabled]': {
+               change: 'toggleFleecing',
+           },
+       }
     },
 
     onGetValues: function(formValues) {
@@ -181,14 +192,11 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
                xtype: 'pveStorageSelector',
                name: 'fleecing-storage',
                fieldLabel: gettext('Fleecing Storage'),
-               reference: 'storageSelector',
+               reference: 'fleecingStorage',
                clusterView: true,
                storageContent: 'images',
                allowBlank: false,
                disabled: true,
-               bind: {
-                   disabled: '{!fleecingEnabled.checked}',
-               },
            },
            endFlex: 2,
            endColumn: {