Am 12.03.26 um 9:40 AM schrieb Arthur Bied-Charreton:
> 'originalValue' is set to null in case it's the default, but getValue
> returns an empty string. This means that when editing a VM's CPU config
> when the model is 'default', the form would always be marked dirty.
>
> Original patch:
> https://lore.proxmox.com/pve-devel/[email protected]/
>
I wonder if this is (still) needed? If I remove the getValue() function,
and instead add the following in www/manager6/form/CPUModelSelector.js
setValue: function (value) {
let me = this;
me.callParent([value]);
console.log('val: ' + value + ' dirty: ' + me.isDirty());
},
for debugging, it doesn't seem to be dirty when the default is set.
> Originally-by: Stefan Reiter <[email protected]>
> Signed-off-by: Arthur Bied-Charreton <[email protected]>
> ---
> www/manager6/form/CPUModelSelector.js | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/www/manager6/form/CPUModelSelector.js
> b/www/manager6/form/CPUModelSelector.js
> index 2ebd08eb..737b6ff4 100644
> --- a/www/manager6/form/CPUModelSelector.js
> +++ b/www/manager6/form/CPUModelSelector.js
> @@ -39,7 +39,11 @@ Ext.define('PVE.form.CPUModelSelector', {
> ],
> width: 360,
> },
> -
> + getValue: function () {
> + let me = this;
> + let val = me.callParent();
> + return val === '' ? null : val;
> + },
> store: {
> autoLoad: true,
> model: 'PVE.data.CPUModel',