service view: fix stale stop/restart button enabled behavior

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>
This commit is contained in:
Oguz Bektas 2021-07-13 13:03:15 +02:00 committed by Thomas Lamprecht
parent ae6a1cc908
commit 0c15c08eee

View 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);