When opened for the first time (undefined value in datacenter.cfg) we should
allow setting both options yes and no for the package_update checkbox.

Signed-off-by: Dominic Jäger <d.jae...@proxmox.com>
---
v2: new

 www/manager6/dc/OptionView.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index ec6ff1a3..de7cbce9 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -35,6 +35,17 @@ Ext.define('PVE.dc.OptionView', {
 
                    Ext.Array.each(this.query('inputpanel'), function(panel) {
                        panel.setValues(edit_value);
+
+                       if (name === 'notify') {
+                           // Default depends on subscription status.
+                           // Therefore, when datacenter.cfg contains nothing
+                           // about package updates then allow setting both yes
+                           // and no for it.
+                           if (!edit_value || typeof 
edit_value.package_updates === 'undefined') {
+                               const field = 
panel.down('field[name=package_updates]');
+                               field.isDirty = () => true;
+                           }
+                       }
                    });
                },
                url: opts.url,
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to