NodeSelector: add disallowedNodes configuration property

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

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2016-11-17 16:49:54 +01:00 committed by Dietmar Maurer
parent a7c2cda748
commit b6eb65687b

View File

@ -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);
}
}));
}
});