public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Kral <d.kral@proxmox.com>
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	[thread overview]
Message-ID: <20260409114224.323102-5-d.kral@proxmox.com> (raw)
In-Reply-To: <20260409114224.323102-1-d.kral@proxmox.com>

This is in preparation to further constrain when auto rebalancing can be
enabled in a following patch.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 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





  parent reply	other threads:[~2026-04-09 11:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 11:41 [PATCH-SERIES manager/docs 00/18] crs docs updates + load balancer ui and docs followup Daniel Kral
2026-04-09 11:41 ` [PATCH manager 01/18] ui: form/CRSOptions: add missing edit modal title Daniel Kral
2026-04-09 11:41 ` [PATCH manager 02/18] ui: form/CRSOptions: rename HA Scheduling to Scheduling Mode Daniel Kral
2026-04-09 11:41 ` [PATCH manager 03/18] ui: form/CRSOptions: replace HA service term with HA resource Daniel Kral
2026-04-09 11:41 ` Daniel Kral [this message]
2026-04-09 11:41 ` [PATCH manager 05/18] ui: form/CRSOptions: allow auto rebalancing only for static and dynamic mode Daniel Kral
2026-04-09 11:41 ` [PATCH docs 06/18] ha-manager: crs: replace service term with HA resource Daniel Kral
2026-04-09 11:41 ` [PATCH docs 07/18] ha-manager: crs: remove note about manual changes to datacenter config Daniel Kral
2026-04-10  8:17   ` Shannon Sterz
2026-04-10 11:18     ` Daniel Kral
2026-04-10 11:37       ` Shannon Sterz
2026-04-09 11:41 ` [PATCH docs 08/18] ha-manager: crs: improve introduction Daniel Kral
2026-04-09 11:41 ` [PATCH docs 09/18] ha-manager: crs: introduce crs scheduling mode section Daniel Kral
2026-04-09 11:41 ` [PATCH docs 10/18] ha-manager: crs: generalize the description for basic and static load modes Daniel Kral
2026-04-09 11:41 ` [PATCH docs 11/18] ha-manager: crs: remove HA group config from scheduling points list Daniel Kral
2026-04-09 11:41 ` [PATCH docs 12/18] ha-manager: crs: use headings for the scheduling points Daniel Kral
2026-04-09 11:41 ` [PATCH docs 13/18] ha-manager: crs: reword the rebalance on start scheduling point Daniel Kral
2026-04-09 11:41 ` [PATCH docs 14/18] ha-manager: crs: add more information about rebalance on start in its section Daniel Kral
2026-04-09 11:41 ` [PATCH docs 15/18] ha-manager: crs: change crs modes to include all active guests Daniel Kral
2026-04-09 11:41 ` [PATCH docs 16/18] ha-manager: crs: add dynamic load scheduler Daniel Kral
2026-04-09 11:41 ` [PATCH docs 17/18] screenshots: update crs datacenter options screenshot Daniel Kral
2026-04-09 11:41 ` [PATCH docs 18/18] ha-manager: crs: add load balancer section Daniel Kral

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=20260409114224.323102-5-d.kral@proxmox.com \
    --to=d.kral@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