]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/node/ServiceView.js
service view: fix stale stop/restart button enabled behavior
[proxmox-widget-toolkit.git] / src / node / ServiceView.js
index a9e6020f409681472217700ba7423f7330e365a0..5b7e82a3e6b95342f148bb66db52b352a0d2976f 100644 (file)
@@ -115,22 +115,22 @@ Ext.define('Proxmox.node.ServiceView', {
            syslog_btn.enable();
 
            if (state === 'running') {
-               start_btn.disable();
-               restart_btn.enable();
+               if (me.startOnlyServices[service]) {
+                   stop_btn.disable();
+                   restart_btn.enable();
+               } else {
+                   stop_btn.enable();
+                   restart_btn.enable();
+                   start_btn.disable();
+               }
            } else if (unit !== undefined && (unit === 'masked' || unit === 'unknown')) {
                start_btn.disable();
                restart_btn.disable();
            } else {
                start_btn.enable();
+               stop_btn.disable();
                restart_btn.disable();
            }
-           if (!me.startOnlyServices[service]) {
-               if (state === 'running') {
-                   stop_btn.enable();
-               } else {
-                   stop_btn.disable();
-               }
-           }
        };
 
        me.mon(store, 'refresh', set_button_status);