ui: NodeSelector: check status field for offline nodes

the memory stat is not available if the user has no audit privilges on
/nodes/NODENAME but the status is always available

also it makes simple more sense to check if it is online not only if the
memory value is there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-05-08 11:12:23 +02:00 committed by Thomas Lamprecht
parent 69106e5cf3
commit c0d4a151fd

View File

@ -74,7 +74,7 @@ Ext.define('PVE.form.NodeSelector', {
Ext.Array.each(value.split(/\s*,\s*/), function(node) {
var rec = me.store.findRecord(me.valueField, node);
if (!(rec && rec.data) || !Ext.isNumeric(rec.data.mem)) {
if (!(rec && rec.data) || rec.data.status !== 'online') {
offline.push(node);
} else if (me.allowedNodes && !Ext.Array.contains(me.allowedNodes, node)) {
notAllowed.push(node);