From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2EA1F1FF17A for ; Fri, 4 Jul 2025 20:20:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0C2EC3D635; Fri, 4 Jul 2025 20:21:16 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Fri, 4 Jul 2025 20:20:58 +0200 Message-Id: <20250704182102.467624-16-d.kral@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250704182102.467624-1-d.kral@proxmox.com> References: <20250704182102.467624-1-d.kral@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 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 v3 1/3] ui: ha: rules: add ha resource affinity rules 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 HA resource affinity rules as a second rule type to the HA Rules' tab page as a separate grid so that the columns match the content of these rules better. Signed-off-by: Daniel Kral --- www/manager6/Makefile | 2 ++ www/manager6/ha/Rules.js | 12 +++++++ .../ha/rules/ResourceAffinityRuleEdit.js | 24 ++++++++++++++ .../ha/rules/ResourceAffinityRules.js | 31 +++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 www/manager6/ha/rules/ResourceAffinityRuleEdit.js create mode 100644 www/manager6/ha/rules/ResourceAffinityRules.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 3d3450c7..8c9c8610 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -151,6 +151,8 @@ JSSRC= \ ha/StatusView.js \ ha/rules/NodeAffinityRuleEdit.js \ ha/rules/NodeAffinityRules.js \ + ha/rules/ResourceAffinityRuleEdit.js \ + ha/rules/ResourceAffinityRules.js \ dc/ACLView.js \ dc/ACMEClusterView.js \ dc/AuthEditBase.js \ diff --git a/www/manager6/ha/Rules.js b/www/manager6/ha/Rules.js index 8f487465..1799d25f 100644 --- a/www/manager6/ha/Rules.js +++ b/www/manager6/ha/Rules.js @@ -167,6 +167,17 @@ Ext.define( flex: 1, border: 0, }, + { + xtype: 'splitter', + collapsible: false, + performCollapse: false, + }, + { + title: gettext('HA Resource Affinity Rules'), + xtype: 'pveHAResourceAffinityRulesView', + flex: 1, + border: 0, + }, ], }, function () { @@ -180,6 +191,7 @@ Ext.define( 'errors', 'disable', 'comment', + 'affinity', 'resources', { name: 'strict', diff --git a/www/manager6/ha/rules/ResourceAffinityRuleEdit.js b/www/manager6/ha/rules/ResourceAffinityRuleEdit.js new file mode 100644 index 00000000..3bfb2c49 --- /dev/null +++ b/www/manager6/ha/rules/ResourceAffinityRuleEdit.js @@ -0,0 +1,24 @@ +Ext.define('PVE.ha.rules.ResourceAffinityInputPanel', { + extend: 'PVE.ha.RuleInputPanel', + + initComponent: function () { + let me = this; + + me.column1 = []; + + me.column2 = [ + { + xtype: 'proxmoxKVComboBox', + name: 'affinity', + fieldLabel: gettext('Affinity'), + allowBlank: false, + comboItems: [ + ['positive', gettext('Keep together')], + ['negative', gettext('Keep separate')], + ], + }, + ]; + + me.callParent(); + }, +}); diff --git a/www/manager6/ha/rules/ResourceAffinityRules.js b/www/manager6/ha/rules/ResourceAffinityRules.js new file mode 100644 index 00000000..6205881e --- /dev/null +++ b/www/manager6/ha/rules/ResourceAffinityRules.js @@ -0,0 +1,31 @@ +Ext.define('PVE.ha.ResourceAffinityRulesView', { + extend: 'PVE.ha.RulesBaseView', + alias: 'widget.pveHAResourceAffinityRulesView', + + ruleType: 'resource-affinity', + ruleTitle: gettext('HA Resource Affinity'), + inputPanel: 'ResourceAffinityInputPanel', + faIcon: 'link', + + stateful: true, + stateId: 'grid-ha-resource-affinity-rules', + + initComponent: function () { + let me = this; + + me.columns = [ + { + header: gettext('Affinity'), + width: 100, + dataIndex: 'affinity', + }, + { + header: gettext('HA Resources'), + flex: 1, + dataIndex: 'resources', + }, + ]; + + me.callParent(); + }, +}); -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel