From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 8BA201FF13F for ; Thu, 09 Apr 2026 13:42:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 16FCB7F0; Thu, 9 Apr 2026 13:42:37 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH manager 04/18] ui: form/CRSOptions: use view model for auto rebalancing option Date: Thu, 9 Apr 2026 13:41:30 +0200 Message-ID: <20260409114224.323102-5-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260409114224.323102-1-d.kral@proxmox.com> References: <20260409114224.323102-1-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775734879625 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.082 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZPYG3UJ6LLGE44JHSUPM6RO4VSAKX7GY X-Message-ID-Hash: ZPYG3UJ6LLGE44JHSUPM6RO4VSAKX7GY X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is in preparation to further constrain when auto rebalancing can be enabled in a following patch. Signed-off-by: Daniel Kral --- www/manager6/form/CRSOptions.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/www/manager6/form/CRSOptions.js b/www/manager6/form/CRSOptions.js index 0d23ad39..3f3b4fea 100644 --- a/www/manager6/form/CRSOptions.js +++ b/www/manager6/form/CRSOptions.js @@ -17,7 +17,14 @@ Ext.define('PVE.form.CRSOptions', { }); }, - viewModel: {}, + viewModel: { + data: { + autoRebalancing: 0, + }, + formulas: { + autoRebalancingDisabled: (get) => !get('autoRebalancing'), + }, + }, items: [ { @@ -58,8 +65,9 @@ Ext.define('PVE.form.CRSOptions', { name: 'ha-auto-rebalance', fieldLabel: gettext('Automatic Rebalance'), boxLabel: gettext('Automatically rebalance HA resources'), - value: 0, - reference: 'enableAutoRebalance', + bind: { + value: '{autoRebalancing}', + }, }, { xtype: 'numberfield', @@ -69,7 +77,7 @@ Ext.define('PVE.form.CRSOptions', { minValue: 0.0, step: 0.01, bind: { - disabled: '{!enableAutoRebalance.checked}', + disabled: '{autoRebalancingDisabled}', }, }, { @@ -85,7 +93,7 @@ Ext.define('PVE.form.CRSOptions', { ], defaultValue: '__default__', bind: { - disabled: '{!enableAutoRebalance.checked}', + disabled: '{autoRebalancingDisabled}', }, }, { @@ -96,7 +104,7 @@ Ext.define('PVE.form.CRSOptions', { minValue: 0, step: 1, bind: { - disabled: '{!enableAutoRebalance.checked}', + disabled: '{autoRebalancingDisabled}', }, }, { @@ -108,7 +116,7 @@ Ext.define('PVE.form.CRSOptions', { maxValue: 1.0, step: 0.01, bind: { - disabled: '{!enableAutoRebalance.checked}', + disabled: '{autoRebalancingDisabled}', }, }, ], -- 2.47.3