[PATCH pve-manager v4 11/17] ui: cpu model selector: allow filtering out custom models

Arthur Bied-Charreton
2026-04-30T16:01:45Z

Add 'showCustomModels' configuration parameter. When set to false, only
default CPU models will be shown.

This is needed when using the CPUModelSelector in the context of
creating a new custom CPU model, where we do not want to allow the
reported-model being another custom CPU model.

Based on patch by Stefan Reiter, with allowCustom renamed to
showCustomModels:
https://lore.proxmox.com/pve-devel/20211028114150.3245864-8-s.reiter@proxmox.com/

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
www/manager6/form/CPUModelSelector.js | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/www/manager6/form/CPUModelSelector.js b/www/manager6/form/CPUModelSelector.js
index a55d473e..a718d2ed 100644
--- a/www/manager6/form/CPUModelSelector.js
+++ b/www/manager6/form/CPUModelSelector.js
@@ -19,6 +19,9 @@ Ext.define('PVE.form.CPUModelSelector', {
autoSelect: false,

deleteEmpty: true,
+ config: {
+ showCustomModels: true,
+ },

getSubmitData: function () {
let me = this,
@@ -135,4 +138,11 @@ Ext.define('PVE.form.CPUModelSelector', {
},
},
},
+ initComponent: function () {
+ let me = this;
+ me.callParent();
+ if (!me.showCustomModels) {
+ me.getStore().addFilter({ filterFn: (rec) => !rec.data.custom });
+ }
+ },
});
--
2.47.3