]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: node/config: use simply boolean expression for powermngt check
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 3 Apr 2020 05:01:25 +0000 (07:01 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 3 Apr 2020 05:01:25 +0000 (07:01 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/node/Config.js

index 18d7f672053f90b209836ac08d6bb85805c34512..f367827cc41810af221f966ee71982c4538b5b40 100644 (file)
@@ -404,10 +404,8 @@ Ext.define('PVE.node.Config', {
 
        me.mon(me.statusStore, 'load', function(store, records, success) {
            let uptimerec = store.data.get('uptime');
-           let powermgmt = uptimerec ? uptimerec.data.value : false;
-           if (!caps.nodes['Sys.PowerMgmt']) {
-               powermgmt = false;
-           }
+           let powermgmt = caps.nodes['Sys.PowerMgmt'] && uptimerec && uptimerec.data.value;
+
            restartBtn.setDisabled(!powermgmt);
            shutdownBtn.setDisabled(!powermgmt);
            shellBtn.setDisabled(!powermgmt);