mirror of https://github.com/Aidaho12/haproxy-wi
parent
4d7b3da769
commit
cf87534eb2
|
@ -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")
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue