all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC manager 7/9] gui: CPUModelSelector: add 'allowCustom'
Date: Thu, 28 Oct 2021 13:41:48 +0200	[thread overview]
Message-ID: <20211028114150.3245864-8-s.reiter@proxmox.com> (raw)
In-Reply-To: <20211028114150.3245864-1-s.reiter@proxmox.com>

When set to false, only default CPU models will be shown.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 www/manager6/form/CPUModelSelector.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/www/manager6/form/CPUModelSelector.js b/www/manager6/form/CPUModelSelector.js
index a4d883a4..54286d79 100644
--- a/www/manager6/form/CPUModelSelector.js
+++ b/www/manager6/form/CPUModelSelector.js
@@ -25,6 +25,10 @@ Ext.define('PVE.form.CPUModelSelector', {
 
     deleteEmpty: true,
 
+    config: {
+	allowCustom: true,
+    },
+
     listConfig: {
 	columns: [
 	    {
@@ -107,4 +111,16 @@ Ext.define('PVE.form.CPUModelSelector', {
 	    },
 	},
     },
+
+    initComponent: function() {
+	let me = this;
+
+	if (!me.allowCustom) {
+	    me.store.filters = [{
+		filterFn: rec => !rec.data.custom,
+	    }];
+	}
+
+	me.callParent();
+    },
 });
-- 
2.30.2





  parent reply	other threads:[~2021-10-28 11:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 11:41 [pve-devel] [RFC 0/9] Unfinished: Custom CPU type API and GUI Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC pve-qemu 1/9] Add -list-flags command line option Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC qemu-server 2/9] api: add recognized-flags and supported-flags endpoints Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC qemu-server 3/9] api: add /cpu/model/* get endpoint Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC qemu-server 4/9] api: add /cpu/model/* get/create/delete/update endpoints Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC manager 5/9] gui: VMCPUFlagSelector: fix unknownFlags behaviour Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC manager 6/9] gui: CPUModelSelector: fix dirty state on default Stefan Reiter
2021-10-28 11:41 ` Stefan Reiter [this message]
2021-10-28 11:41 ` [pve-devel] [RFC manager 8/9] gui: add basic custom CPU model editor Stefan Reiter
2021-10-28 11:41 ` [pve-devel] [RFC manager 9/9] Initial attempt at CPU flag editor for custom models Stefan Reiter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211028114150.3245864-8-s.reiter@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal