diff --git a/app/modules/service/installation.py b/app/modules/service/installation.py index 8f5a93b..6c3044e 100644 --- a/app/modules/service/installation.py +++ b/app/modules/service/installation.py @@ -369,11 +369,6 @@ def keepalived_master_install(master: str, eth: str, eth_slave: str, vrrp_ip: st haproxy, nginx, '0', firewall ) - try: - os.remove(f'{full_path}/{script}') - except Exception: - pass - if not api: return show_success_installation(service) @@ -454,9 +449,7 @@ def keepalived_masteradd(master, eth, slave_eth, vrrp_ip, router_id, return_to_m except Exception as e: raise Exception(e) - os.remove(f'{full_path}/{script}') - - return show_success_installation('slave VRRP address') + return show_success_installation('master VRRP address') def keepalived_slaveadd(slave, eth, slave_eth, vrrp_ip, router_id, kp): diff --git a/app/routes/add/routes.py b/app/routes/add/routes.py index a0161c0..f309de0 100644 --- a/app/routes/add/routes.py +++ b/app/routes/add/routes.py @@ -375,9 +375,9 @@ def add_haproxy(): return config_add else: try: - return add_mod.save_to_haproxy_config(config_add, server_ip) + return add_mod.save_to_haproxy_config(config_add, server_ip, name) except Exception as e: - return str(e) + return f'error: Cannot add to config: {e}' @bp.post('/haproxy/userlist') @@ -464,9 +464,9 @@ def add_peers(): return config_add, 200 else: try: - return add_mod.save_to_haproxy_config(config_add, server_ip) + return add_mod.save_to_haproxy_config(config_add, server_ip, name) except Exception as e: - return (str(e)), 200 + return f'error: Cannot add to config: {e}' @bp.route('/option/get/') diff --git a/app/templates/logs_internal.html b/app/templates/logs_internal.html index f105e6c..f561623 100644 --- a/app/templates/logs_internal.html +++ b/app/templates/logs_internal.html @@ -53,24 +53,19 @@
+ -
- {{lang.phrases.read_about_files}} {{lang.words.here}} -
+ showApacheLog('{{serv}}'); {% else %} - -
- {{lang.phrases.read_about_files}} {{lang.words.here}} -
+ viewLogs() {% endif %} +if (window.matchMedia('(max-width: 786px)').matches || window.matchMedia('(max-width: 1024px)').matches || window.matchMedia('(max-width: 667px)').matches) { + $("#viewlogs").selectmenu({ + width: 150 + }); +} + +
+ {{lang.phrases.read_about_files}} {{lang.words.here}} +
{% endblock %} \ No newline at end of file diff --git a/inc/script.js b/inc/script.js index 2631d33..3128d6e 100644 --- a/inc/script.js +++ b/inc/script.js @@ -649,17 +649,18 @@ function findGetParameter(parameterName) { return result; } function viewLogs() { - if($('#viewlogs').val() == 'roxy-wi.error.log' || $('#viewlogs').val() == 'roxy-wi.access.log' || $('#viewlogs').val() == 'fail2ban.log') { - showApacheLog($('#viewlogs').val()); + var viewlogs = $('#viewlogs').val(); + if (viewlogs == '------' || viewlogs === null) { return false; } + if(viewlogs == 'roxy-wi.error.log' || viewlogs == 'roxy-wi.access.log' || viewlogs == 'fail2ban.log') { + showApacheLog(viewlogs); } else { - var rows = $('#rows').val() - var grep = $('#grep').val() - var exgrep = $('#exgrep').val() - var hour = $('#time_range_out_hour').val() - var minut = $('#time_range_out_minut').val() - var hour1 = $('#time_range_out_hour1').val() - var minut1 = $('#time_range_out_minut1').val() - var viewlogs = $('#viewlogs').val() + var rows = $('#rows').val(); + var grep = $('#grep').val(); + var exgrep = $('#exgrep').val(); + var hour = $('#time_range_out_hour').val(); + var minute = $('#time_range_out_minut').val(); + var hour1 = $('#time_range_out_hour1').val(); + var minute1 = $('#time_range_out_minut1').val(); var type = findGetParameter('type') if (viewlogs == null){ viewlogs = findGetParameter('viewlogs') @@ -674,9 +675,9 @@ function viewLogs() { grep: grep, exgrep: exgrep, hour: hour, - minut: minut, + minute: minute, hour1: hour1, - minut1: minut1, + minute1: minute1, token: $('#token').val(), }, type: "POST", diff --git a/inc/users.js b/inc/users.js index 6afcd93..a646992 100644 --- a/inc/users.js +++ b/inc/users.js @@ -1927,7 +1927,7 @@ function updateServer(id) { protected_serv = '1'; } var servergroup = $('#servergroup-' + id + ' option:selected').val(); - if (cur_url[0].indexOf('servers') != '-1') { + if (cur_url[0].indexOf('servers#') != '-1') { servergroup = $('#new-server-group-add').val(); } $.ajax({