diff --git a/README.md b/README.md index c914ddf5..92da7951 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # HAProxy-WI -Web interface(user-friendly web GUI, alerting, monitoring and secure) for managing HAProxy servers. Leave your [feedback](https://github.com/Aidaho12/haproxy-wi/issues) +Web interface(user-friendly web GUI, alerting, monitoring and secure) for managing HAProxy, Nginx and Keepalived servers. Leave your [feedback](https://github.com/Aidaho12/haproxy-wi/issues) # Youtube [Demo video](https://www.youtube.com/channel/UCo0lCg24j-H4f0S9kMjp-_w) diff --git a/app/options.py b/app/options.py index 549cfeed..c75112da 100644 --- a/app/options.py +++ b/app/options.py @@ -37,10 +37,7 @@ if form.getvalue('getcerts') is not None and serv is not None: if form.getvalue('checkSshConnect') is not None and serv is not None: - try: - funct.ssh_command(serv, ["ls -1t"]) - except: - print('
Can not connect to the server
') + print(funct.ssh_command(serv, ["ls -1t"])) if form.getvalue('getcert') is not None and serv is not None: @@ -109,7 +106,7 @@ if form.getvalue('action_hap') is not None and serv is not None: if funct.check_haproxy_config(serv): commands = [ "sudo systemctl %s haproxy" % action ] funct.ssh_command(serv, commands) - funct.logging(serv, 'HAProxy was '+action, haproxywi=1, login=1) + funct.logging(serv, 'HAProxy was '+action+'ed', haproxywi=1, login=1) print("HAproxy was %s" % action) else: print("Bad config, check please") @@ -121,7 +118,7 @@ if form.getvalue('action_nginx') is not None and serv is not None: if funct.check_haproxy_config(serv): commands = [ "sudo systemctl %s nginx" % action ] funct.ssh_command(serv, commands) - funct.logging(serv, 'Nginx was '+action, haproxywi=1, login=1) + funct.logging(serv, 'Nginx was '+action+'ed', haproxywi=1, login=1) print("Nginx was %s" % action) else: print("Bad config, check please") @@ -130,7 +127,7 @@ if form.getvalue('action_nginx') is not None and serv is not None: if form.getvalue('action_waf') is not None and serv is not None: serv = form.getvalue('serv') action = form.getvalue('action_waf') - funct.logging(serv, 'WAF service was '+action, haproxywi=1, login=1) + funct.logging(serv, 'WAF service was '+action+'ed', haproxywi=1, login=1) commands = [ "sudo systemctl %s waf" % action ] funct.ssh_command(serv, commands) @@ -1190,10 +1187,13 @@ if form.getvalue('bwlists_create'): list = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')+"/"+form.getvalue('group')+"/"+color+"/"+list_name try: open(list, 'a').close() - print('
'+form.getvalue('color')+' list was created
') - funct.logging(server[1], 'has created '+color+' list '+list_name, haproxywi=1, login=1) + print('
'+color+' list was created
') + try: + funct.logging(server[1], 'has created '+color+' list '+list_name, haproxywi=1, login=1) + except: + pass except IOError as e: - print('
Cat\'n create new '+form.getvalue('color')+' list. %s
' % e) + print('
Cat\'n create new '+color+' list. %s
' % e) if form.getvalue('bwlists_save'): @@ -1217,9 +1217,14 @@ if form.getvalue('bwlists_save'): print('
Upload fail: %s
' % error) else: print('
Edited '+color+' list was uploaded to '+server[1]+'
') - funct.logging(server[1], 'has edited '+color+' list '+bwlists_save, haproxywi=1, login=1) + try: + funct.logging(server[1], 'has edited '+color+' list '+bwlists_save, haproxywi=1, login=1) + except: + pass if form.getvalue('bwlists_restart') == 'restart': funct.ssh_command(server[2], ["sudo systemctl restart haproxy"]) + elif form.getvalue('bwlists_restart') == 'reload': + funct.ssh_command(server[2], ["sudo systemctl reload haproxy"]) if form.getvalue('get_lists'): @@ -1594,4 +1599,4 @@ if form.getvalue('updatesettings') is not None: if sql.update_setting(settings, val): funct.logging('value '+val, ' changed settings '+settings, haproxywi=1, login=1) print("Ok") - \ No newline at end of file + diff --git a/image/haproxy-wi-overview.png b/image/haproxy-wi-overview.png index 16d867b0..07343030 100644 Binary files a/image/haproxy-wi-overview.png and b/image/haproxy-wi-overview.png differ diff --git a/inc/add.js b/inc/add.js index a73b01e5..5f9504f6 100644 --- a/inc/add.js +++ b/inc/add.js @@ -1184,6 +1184,10 @@ function editList(list, color) { $( this ).dialog( "close" ); saveList('save', list, color); }, + "Save and reload": function() { + $( this ).dialog( "close" ); + saveList('reload', list, color); + }, "Save and restart": function() { $( this ).dialog( "close" ); saveList('restart', list, color);