[pve-devel] [PATCH v2 manager] NodeSelector: add disallowedNodes configuration property

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 17 16:49:54 CET 2016


This can be used to mask out some nodes from the node selector.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

changes since v1:
* use ExtJS filter, simplifies code quite a bit

 www/manager6/form/NodeSelector.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/www/manager6/form/NodeSelector.js b/www/manager6/form/NodeSelector.js
index 7193b97..fcb9cb1 100644
--- a/www/manager6/form/NodeSelector.js
+++ b/www/manager6/form/NodeSelector.js
@@ -7,6 +7,9 @@ Ext.define('PVE.form.NodeSelector', {
 
     selectCurNode: false,
 
+    // do not allow those nodes (array)
+    disallowedNodes: undefined,
+
     // only allow those nodes (array)
     allowedNodes: undefined,
     // set default value to empty array, else it inits it with
@@ -97,5 +100,13 @@ Ext.define('PVE.form.NodeSelector', {
 
         me.callParent();
         me.getStore().load();
+
+	// filter out disallowed nodes
+	me.getStore().addFilter(new Ext.util.Filter({
+	    filterFn: function(item) {
+		return !Ext.Array.contains(me.disallowedNodes, item.data.node);
+	    }
+	}));
+
     }
 });
-- 
2.1.4





More information about the pve-devel mailing list