diff --git a/app/modules/service/action.py b/app/modules/service/action.py index 9cca5d51..bea310bd 100644 --- a/app/modules/service/action.py +++ b/app/modules/service/action.py @@ -16,12 +16,11 @@ def action_haproxy(server_ip: str, action: str) -> None: if service_common.check_haproxy_config(server_ip): server_id = sql.select_server_id_by_ip(server_ip=server_ip) + is_docker = sql.select_service_setting(server_id, 'haproxy', 'dockerized') if action == 'restart': service_common.is_not_allowed_to_restart(server_id, 'haproxy') - is_docker = sql.select_service_setting(server_id, 'haproxy', 'dockerized') - if is_docker == '1': container_name = sql.get_setting('haproxy_container_name') commands = [f"sudo docker {action} {container_name}"] @@ -32,8 +31,7 @@ def action_haproxy(server_ip: str, action: str) -> None: commands = [f"sudo systemctl {action} {haproxy_service_name}"] server_mod.ssh_command(server_ip, commands) - roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, - service='haproxy') + roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, service='haproxy') print(f"success: HAProxy has been {action}") else: print("error: Bad config, check please") diff --git a/inc/users.js b/inc/users.js index a6e7d598..58dc239c 100644 --- a/inc/users.js +++ b/inc/users.js @@ -1880,7 +1880,7 @@ function updateUser(id) { if ($('#activeuser-'+id).is(':checked')) { activeuser = '1'; } - if (role == null){ + if (role == null && role !== undefined){ toastr.warning('Please edit this user only on the Admin area'); return false; }