ui: fix reset behavior of backup job editor

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2024-04-23 09:30:24 +02:00 committed by Thomas Lamprecht
parent 676cb7dbff
commit 569b038830
3 changed files with 3 additions and 1 deletions

View File

@ -350,6 +350,7 @@ Ext.define('PVE.dc.BackupEdit', {
], ],
fieldLabel: gettext('Notification mode'), fieldLabel: gettext('Notification mode'),
name: 'notification-mode', name: 'notification-mode',
value: '__default__',
cbind: { cbind: {
deleteEmpty: '{!isCreate}', deleteEmpty: '{!isCreate}',
}, },

View File

@ -62,7 +62,7 @@ Ext.define('PVE.form.SizeField', {
flex: 1, flex: 1,
enableKeyEvents: true, enableKeyEvents: true,
setValue: function(v) { setValue: function(v) {
if (!this._transformed) { if (!this._transformed && v !== null) {
let fieldContainer = this.up('fieldcontainer'); let fieldContainer = this.up('fieldcontainer');
let vm = fieldContainer.getViewModel(); let vm = fieldContainer.getViewModel();
let unit = vm.get('unit'); let unit = vm.get('unit');

View File

@ -185,6 +185,7 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
clusterView: true, clusterView: true,
storageContent: 'images', storageContent: 'images',
allowBlank: false, allowBlank: false,
disabled: true,
bind: { bind: {
disabled: '{!fleecingEnabled.checked}', disabled: '{!fleecingEnabled.checked}',
}, },