From: "Michael Köppl" <m.koeppl@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2 1/1] ui: create wizard: only submit ha-managed if checked for better compat
Date: Mon, 17 Nov 2025 18:33:21 +0100 [thread overview]
Message-ID: <20251117173321.240894-1-m.koeppl@proxmox.com> (raw)
Avoid sending the parameter with the default value when it's not
necessary, improving compatibility in cases where the ha-managed param
is not recognized (e.g. when creating a guest on another node that does
not support the parameter). Setting uncheckedValue to undefined results
in the value of the checkbox not being submitted upon submission of the
form if the checkbox is left unchecked or explicitly set unchecked [0].
The API already considers the ha-managed param optional and sets a
default value of 0.
Even though undefined is the default value for uncheckedValue, set it
explicitly to make the intent clearer.
[0] https://docs.sencha.com/extjs/7.0.0/classic/Ext.form.field.Checkbox.html#cfg-uncheckedValue
Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
www/manager6/lxc/CreateWizard.js | 4 ++--
www/manager6/qemu/CreateWizard.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/www/manager6/lxc/CreateWizard.js b/www/manager6/lxc/CreateWizard.js
index f35709f14..46835e7ae 100644
--- a/www/manager6/lxc/CreateWizard.js
+++ b/www/manager6/lxc/CreateWizard.js
@@ -85,8 +85,8 @@ Ext.define('PVE.lxc.CreateWizard', {
{
xtype: 'proxmoxcheckbox',
name: 'ha-managed',
- uncheckedValue: 0,
- defaultValue: 0,
+ // only submit value of checkbox if checked
+ uncheckedValue: undefined,
fieldLabel: gettext('Add to HA'),
},
],
diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js
index e0c56bc0b..341324c85 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -99,8 +99,8 @@ Ext.define('PVE.qemu.CreateWizard', {
{
xtype: 'proxmoxcheckbox',
name: 'ha-managed',
- uncheckedValue: 0,
- defaultValue: 0,
+ // only submit value of checkbox if checked
+ uncheckedValue: undefined,
fieldLabel: gettext('Add to HA'),
},
],
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-11-17 17:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 17:33 Michael Köppl [this message]
2025-11-17 21:25 ` [pve-devel] 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=20251117173321.240894-1-m.koeppl@proxmox.com \
--to=m.koeppl@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.