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 EE3AE1FF164 for ; Fri, 20 Jun 2025 16:38:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A1A3DF01B; Fri, 20 Jun 2025 16:39:04 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Fri, 20 Jun 2025 16:31:45 +0200 Message-Id: <20250620143148.218469-38-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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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 2/5] ui: add use-location-rules feature flag X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Add 'use-location-rules' feature flag to the datacenter options input panel to control the behavior of the HA Manager, API endpoints, and web interface to either use and show HA Groups (disabled), or use and show HA Location rules (enabled). The util helper is used in following patches to control existing and new behavior to act correctly. Signed-off-by: Daniel Kral --- I'm not that happy with the many calls that are made to the getHALocationFeatureStatus(...) helper function and in general the calls to the API endpoint. I'd like some more feedback how we could handle the migration part better (for this and the following patches). changes since v1: - NEW! www/manager6/Utils.js | 5 +++++ www/manager6/dc/OptionView.js | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 29334111..6f58fd20 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -45,6 +45,11 @@ Ext.define('PVE.Utils', { return levelMap; }, + getHALocationFeatureStatus: async function () { + let { result } = await Proxmox.Async.api2({ url: '/cluster/options' }); + return result?.data?.ha?.['use-location-rules'] === 1; + }, + kvm_ostypes: { Linux: [ { desc: '6.x - 2.6 Kernel', val: 'l26' }, diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js index 20d74b6f..68309e39 100644 --- a/www/manager6/dc/OptionView.js +++ b/www/manager6/dc/OptionView.js @@ -148,6 +148,19 @@ Ext.define('PVE.dc.OptionView', { ], defaultValue: '__default__', }, + { + xtype: 'proxmoxcheckbox', + name: 'use-location-rules', + fieldLabel: gettext('Use HA Location rules'), + boxLabel: gettext('Replace HA Groups with HA Location rules'), + value: 0, + }, + { + xtype: 'box', + html: + `${gettext('Note:')} ` + + gettext('HA Groups need to be manually migrated to HA Location rules.'), + }, ], }); me.add_inputpanel_row('crs', gettext('Cluster Resource Scheduling'), { -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel