Changelog: https://roxy-wi.org/changelog#6_3_7
pull/355/head
Aidaho 2023-03-05 20:20:05 +03:00
parent 4d7b3da769
commit cf87534eb2
2 changed files with 3 additions and 5 deletions

View File

@ -16,12 +16,11 @@ def action_haproxy(server_ip: str, action: str) -> None:
if service_common.check_haproxy_config(server_ip): if service_common.check_haproxy_config(server_ip):
server_id = sql.select_server_id_by_ip(server_ip=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': if action == 'restart':
service_common.is_not_allowed_to_restart(server_id, 'haproxy') service_common.is_not_allowed_to_restart(server_id, 'haproxy')
is_docker = sql.select_service_setting(server_id, 'haproxy', 'dockerized')
if is_docker == '1': if is_docker == '1':
container_name = sql.get_setting('haproxy_container_name') container_name = sql.get_setting('haproxy_container_name')
commands = [f"sudo docker {action} {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}"] commands = [f"sudo systemctl {action} {haproxy_service_name}"]
server_mod.ssh_command(server_ip, commands) 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, roxywi_common.logging(server_ip, f'Service has been {action}ed', roxywi=1, login=1, keep_history=1, service='haproxy')
service='haproxy')
print(f"success: HAProxy has been {action}") print(f"success: HAProxy has been {action}")
else: else:
print("error: Bad config, check please") print("error: Bad config, check please")

View File

@ -1880,7 +1880,7 @@ function updateUser(id) {
if ($('#activeuser-'+id).is(':checked')) { if ($('#activeuser-'+id).is(':checked')) {
activeuser = '1'; activeuser = '1';
} }
if (role == null){ if (role == null && role !== undefined){
toastr.warning('Please edit this user only on the Admin area'); toastr.warning('Please edit this user only on the Admin area');
return false; return false;
} }