[pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior

Dominik Csapak d.csapak at proxmox.com
Wed Apr 24 13:03:58 CEST 2024


two similar things to fix here:
* the 'crypt-allow-edit' field was not submitted, but it's value was
  only ever set with a bind, so a reset always set it to it's
  default 'false' value (disabling the radio buttons, even when
  it was not visible)

* the initial value of the 'keep' variant of the radiofield was decided
  only from 'isCreate' (via the 'checked' cbind), but should have been
  decided by whether there was an encryption key or not.

both are fixed by setting the values in the 'setValue' method
explicitly

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/storage/PBSEdit.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
index 70dc42f5..95bf0a50 100644
--- a/www/manager6/storage/PBSEdit.js
+++ b/www/manager6/storage/PBSEdit.js
@@ -220,11 +220,14 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 		// old key without FP
 		values['crypt-key-fp'] = icon + gettext('Active');
 	    }
+	    values.cryptMode = 'keep';
+	    values['crypt-allow-edit'] = false;
 	} else {
 	    values['crypt-key-fp'] = gettext('None');
 	    let cryptModeNone = me.down('radiofield[inputValue=none]');
 	    cryptModeNone.setBoxLabel(gettext('Do not encrypt backups'));
-	    cryptModeNone.setValue(true);
+	    values.cryptMode = 'none';
+	    values['crypt-allow-edit'] = true;
 	}
 	vm.set('keepCryptVisible', !!cryptKeyInfo);
 	vm.set('allowEdit', !cryptKeyInfo);
@@ -272,7 +275,6 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 	    padding: '0 0 0 25',
 	    cbind: {
 		hidden: '{isCreate}',
-		checked: '{!isCreate}',
 	    },
 	    bind: {
 		hidden: '{!keepCryptVisible}',
-- 
2.39.2





More information about the pve-devel mailing list