]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: NodeSelector: check status field for offline nodes
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 8 May 2019 09:12:23 +0000 (11:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 May 2019 16:30:22 +0000 (16:30 +0000)
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>
www/manager6/form/NodeSelector.js

index 3cd7835f42074a1e18b059d60d4337708263c98a..76a55f246c027b76a5f22b42671b33f8f6aedc64 100644 (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);