]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
service view: fix stale stop/restart button enabled behavior
authorOguz Bektas <o.bektas@proxmox.com>
Tue, 13 Jul 2021 11:03:15 +0000 (13:03 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jul 2021 16:35:43 +0000 (18:35 +0200)
fix an issue where the stop or restart button stays enabled for
elements in 'startOnlyServices' after switching selection from a
service that was not restricted to start-only

note: front-end change only as the backend already refused to stop a
start-only service.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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);