public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager] ui: qga: parse boolean properties to correctly detect 'yes' and 'on' values
Date: Mon, 16 Mar 2026 17:17:05 +0100	[thread overview]
Message-ID: <20260316161802.189267-1-f.ebner@proxmox.com> (raw)

Passing a 'yes' or 'on' value along to the checkbox would leave the
checkbox disabled.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 www/manager6/form/AgentFeatureSelector.js | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/www/manager6/form/AgentFeatureSelector.js b/www/manager6/form/AgentFeatureSelector.js
index f1e30e21..a484bd99 100644
--- a/www/manager6/form/AgentFeatureSelector.js
+++ b/www/manager6/form/AgentFeatureSelector.js
@@ -124,21 +124,14 @@ Ext.define('PVE.form.AgentFeatureSelector', {
         let vm = me.getViewModel();
 
         let res = PVE.Parser.parsePropertyString(values.agent, 'enabled');
+        res.enabled = PVE.Parser.parseBoolean(res.enabled, false);
+        res.fstrim_cloned_disks = PVE.Parser.parseBoolean(res.fstrim_cloned_disks, false);
+        res['freeze-fs-on-backup'] = PVE.Parser.parseBoolean(res['freeze-fs-on-backup'], true);
+        res['guest-fsfreeze'] = PVE.Parser.parseBoolean(res['guest-fsfreeze'], true);
 
         // We hide the switch for the deprecated freeze-fs-on-backup if the setting was not
         // explicitly set by the user or if was explicitly enabled.
-        vm.set(
-            'hideFreezeFsOnBackup',
-            !Ext.isDefined(res['freeze-fs-on-backup']) ||
-                PVE.Parser.parseBoolean(res['freeze-fs-on-backup']),
-        );
-
-        if (!Ext.isDefined(res['freeze-fs-on-backup'])) {
-            res['freeze-fs-on-backup'] = 1;
-        }
-        if (!Ext.isDefined(res['guest-fsfreeze'])) {
-            res['guest-fsfreeze'] = 1;
-        }
+        vm.set('hideFreezeFsOnBackup', res['freeze-fs-on-backup']);
 
         me.callParent([res]);
     },
-- 
2.47.3





             reply	other threads:[~2026-03-16 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 16:17 Fiona Ebner [this message]
2026-03-16 18:22 ` applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260316161802.189267-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal