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 198D31FF133 for ; Mon, 11 May 2026 15:43:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DC64E1A67F; Mon, 11 May 2026 15:43:27 +0200 (CEST) Message-ID: <77cb01f2-aa15-4064-b6e2-234732c36422@proxmox.com> Date: Mon, 11 May 2026 15:42:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-manager v4 15/17] ui: cpu flags selector: allow filtering out flags supported on 0 nodes From: Fiona Ebner To: Arthur Bied-Charreton , pve-devel@lists.proxmox.com References: <20260430160109.565536-1-a.bied-charreton@proxmox.com> <20260430160109.565536-16-a.bied-charreton@proxmox.com> <70775287-c5c8-41ba-abef-b4e6ea71d5f4@proxmox.com> Content-Language: en-US In-Reply-To: <70775287-c5c8-41ba-abef-b4e6ea71d5f4@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778506862657 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 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: D5KRM2Y64P77ZRH5MRRDUNCDRK6E2HI3 X-Message-ID-Hash: D5KRM2Y64P77ZRH5MRRDUNCDRK6E2HI3 X-MailFrom: f.ebner@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: Am 11.05.26 um 3:39 PM schrieb Fiona Ebner: > Am 30.04.26 um 6:00 PM schrieb Arthur Bied-Charreton: >> The cpu-flags endpoints may return some CPU flags that are not supported >> on any node in the cluster. Filter those out by default in the UI, >> giving the option to display them via a checkbox. >> >> Unknown flags are still shown at the top of the list. >> >> Signed-off-by: Arthur Bied-Charreton >> --- >> www/manager6/form/VMCPUFlagSelector.js | 37 ++++++++++++++++++++++++++ >> 1 file changed, 37 insertions(+) >> >> diff --git a/www/manager6/form/VMCPUFlagSelector.js b/www/manager6/form/VMCPUFlagSelector.js >> index 3cc66a3e..ef9555e6 100644 >> --- a/www/manager6/form/VMCPUFlagSelector.js >> +++ b/www/manager6/form/VMCPUFlagSelector.js >> @@ -354,6 +354,43 @@ Ext.define('PVE.form.VMCPUFlagSelector', { >> }, >> ]; >> >> + me.dockedItems.push({ >> + xtype: 'toolbar', >> + dock: 'bottom', >> + items: [ >> + { >> + xtype: 'checkbox', >> + checked: true, >> + submitValue: false, >> + isFormField: false, >> + boxLabel: gettext('Only show flags supported by at least one node'), >> + listeners: { >> + change: function (cb, checked) { >> + let store = cb.up('grid').getStore(); >> + if (checked) { >> + store.addFilter({ >> + id: 'supported-filter', >> + filterFn: (rec) => { >> + let state = rec.get('state'); >> + if (state && state !== '=') { >> + return true; >> + } >> + if (rec.get('unknown')) { >> + return true; >> + } >> + let s = rec.get('supported-on'); >> + return Array.isArray(s) && s.length > 0; > > Can we somehow re-use the function from the original filters rather than > re-implement it? I should clarify the remove/addFilter part is fine, I'm just talking about re-using the implementation of the function.