[pve-devel] [PATCH manager] ui: fix reset behavior of backup job editor

Dominik Csapak d.csapak at proxmox.com
Tue Apr 23 09:30:24 CEST 2024


when we `bind` we also have to set the initial value correctly,
otherwise the form dirty tracking is off (the initial bind set does not
reset the `originalValue`)

also the bandwidth selector auto transformed the value `null` to `0`
when there was no initial transformation. Since this is not a valid
value anyway, skip that.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Backup.js                   | 1 +
 www/manager6/form/BandwidthSelector.js      | 2 +-
 www/manager6/panel/BackupAdvancedOptions.js | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index cd4ece33..336b23f5 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -350,6 +350,7 @@ Ext.define('PVE.dc.BackupEdit', {
 				    ],
 				    fieldLabel: gettext('Notification mode'),
 				    name: 'notification-mode',
+				    value: '__default__',
 				    cbind: {
 					deleteEmpty: '{!isCreate}',
 				    },
diff --git a/www/manager6/form/BandwidthSelector.js b/www/manager6/form/BandwidthSelector.js
index 01ec8f9c..6f20af3a 100644
--- a/www/manager6/form/BandwidthSelector.js
+++ b/www/manager6/form/BandwidthSelector.js
@@ -62,7 +62,7 @@ Ext.define('PVE.form.SizeField', {
 	    flex: 1,
 	    enableKeyEvents: true,
 	    setValue: function(v) {
-		if (!this._transformed) {
+		if (!this._transformed && v !== null) {
 		    let fieldContainer = this.up('fieldcontainer');
 		    let vm = fieldContainer.getViewModel();
 		    let unit = vm.get('unit');
diff --git a/www/manager6/panel/BackupAdvancedOptions.js b/www/manager6/panel/BackupAdvancedOptions.js
index c79c31cb..f1810637 100644
--- a/www/manager6/panel/BackupAdvancedOptions.js
+++ b/www/manager6/panel/BackupAdvancedOptions.js
@@ -185,6 +185,7 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 		clusterView: true,
 		storageContent: 'images',
 		allowBlank: false,
+		disabled: true,
 		bind: {
 		    disabled: '{!fleecingEnabled.checked}',
 		},
-- 
2.39.2





More information about the pve-devel mailing list