From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 123071FF164 for <inbox@lore.proxmox.com>; Fri, 20 Jun 2025 16:35:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7E623E8DF; Fri, 20 Jun 2025 16:32:48 +0200 (CEST) From: Daniel Kral <d.kral@proxmox.com> To: pve-devel@lists.proxmox.com Date: Fri, 20 Jun 2025 16:31:47 +0200 Message-Id: <20250620143148.218469-40-d.kral@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250620143148.218469-1-d.kral@proxmox.com> References: <20250620143148.218469-1-d.kral@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 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 Subject: [pve-devel] [PATCH manager v2 4/5] ui: ha: adapt resources components if use-location-rules is enabled X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> Remove the group selector from the Resources grid view and edit window and replace it with the 'failback' field if the use-location-rules feature flag is enabled. Signed-off-by: Daniel Kral <d.kral@proxmox.com> --- changes since v1: - NEW! www/manager6/ha/ResourceEdit.js | 27 ++++++++++++++++++++++----- www/manager6/ha/Resources.js | 7 +++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/www/manager6/ha/ResourceEdit.js b/www/manager6/ha/ResourceEdit.js index 1048ccca..f900db62 100644 --- a/www/manager6/ha/ResourceEdit.js +++ b/www/manager6/ha/ResourceEdit.js @@ -12,6 +12,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', { delete values.vmid; PVE.Utils.delete_if_default(values, 'group', '', me.isCreate); + PVE.Utils.delete_if_default(values, 'failback', '1', me.isCreate); PVE.Utils.delete_if_default(values, 'max_restart', '1', me.isCreate); PVE.Utils.delete_if_default(values, 'max_relocate', '1', me.isCreate); @@ -109,11 +110,6 @@ Ext.define('PVE.ha.VMResourceInputPanel', { ]; me.column2 = [ - { - xtype: 'pveHAGroupSelector', - name: 'group', - fieldLabel: gettext('Group'), - }, { xtype: 'proxmoxKVComboBox', name: 'state', @@ -138,6 +134,26 @@ Ext.define('PVE.ha.VMResourceInputPanel', { disabledHint, ]; + if (me.showGroups) { + me.column2.unshift({ + xtype: 'pveHAGroupSelector', + name: 'group', + fieldLabel: gettext('Group'), + }); + } else { + me.column2.push({ + xtype: 'proxmoxcheckbox', + name: 'failback', + fieldLabel: gettext('Failback'), + autoEl: { + tag: 'div', + 'data-qtip': gettext('Enable if service should be on highest priority node.'), + }, + uncheckedValue: 0, + value: 1, + }); + } + me.columnB = [ { xtype: 'textfield', @@ -177,6 +193,7 @@ Ext.define('PVE.ha.VMResourceEdit', { isCreate: me.isCreate, vmid: me.vmid, guestType: me.guestType, + showGroups: me.showGroups, }); Ext.apply(me, { diff --git a/www/manager6/ha/Resources.js b/www/manager6/ha/Resources.js index e8e53b3b..6f09a714 100644 --- a/www/manager6/ha/Resources.js +++ b/www/manager6/ha/Resources.js @@ -14,6 +14,11 @@ Ext.define('PVE.ha.ResourcesView', { throw 'no store given'; } + me.showGroups = true; + PVE.Utils.getHALocationFeatureStatus().then((isHALocationEnabled) => { + me.showGroups = !isHALocationEnabled; + }); + Proxmox.Utils.monStoreErrors(me, me.rstore); let store = Ext.create('Proxmox.data.DiffStore', { rstore: me.rstore, @@ -42,6 +47,7 @@ Ext.define('PVE.ha.ResourcesView', { destroy: () => me.rstore.load(), }, autoShow: true, + showGroups: me.showGroups, }); }; @@ -63,6 +69,7 @@ Ext.define('PVE.ha.ResourcesView', { destroy: () => me.rstore.load(), }, autoShow: true, + showGroups: me.showGroups, }); }, }, -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel