[PATCH pve-manager v4 15/17] ui: cpu flags selector: allow filtering out flags supported on 0 nodes

Arthur Bied-Charreton
2026-04-30T16:02:07Z

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 <a.bied-charreton@proxmox.com>
---
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;
+ },
+ });
+ } else {
+ store.removeFilter('supported-filter');
+ }
+ },
+ },
+ },
+ ],
+ });
+
me.callParent(arguments);

me.initialized = true;
--
2.47.3