From 5c18a2d83705d01fb4d2889a4d98fc7342ebaa87 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Wed, 6 Jul 2022 11:51:02 +0300 Subject: [PATCH] v6.1.1.0 Change log: https://roxy-wi.org/changelog.py#6_1_1 --- app/options.py | 2 +- app/templates/ajax/load_updatehapwi.html | 2 +- app/templates/nettools.html | 6 +++--- app/templates/ovw.html | 2 +- inc/add.js | 4 +++- inc/configshow.js | 2 +- inc/script.js | 14 ++++++++------ 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/options.py b/app/options.py index fd53ab37..d3dc62bd 100644 --- a/app/options.py +++ b/app/options.py @@ -89,7 +89,7 @@ if serv and form.getvalue('ssl_cert'): if form.getvalue('ssl_name') is None: print('error: Please enter a desired name') else: - name = form.getvalue('ssl_name') + name = form.getvalue('ssl_name').replace(';', '').replace('&', '') try: with open(name, "w") as ssl_cert: diff --git a/app/templates/ajax/load_updatehapwi.html b/app/templates/ajax/load_updatehapwi.html index 830d91ca..f82c6655 100644 --- a/app/templates/ajax/load_updatehapwi.html +++ b/app/templates/ajax/load_updatehapwi.html @@ -86,7 +86,7 @@ {% set description = 'Socket is a service for sending alerts and notifications' %} {% endif %} - {{service_name}} + {{service_name}} {% if s.3 != '* is not installed' and s.3 != '' %} diff --git a/app/templates/nettools.html b/app/templates/nettools.html index d5ad773d..9338d497 100644 --- a/app/templates/nettools.html +++ b/app/templates/nettools.html @@ -140,7 +140,7 @@ data: frm.serialize(), type: frm.attr('method'), success: function( data ) { - data = data.replace('\n', '
'); + data = data.replace(/\n/g, "
"); if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') { $('#ajax-nettools').html('
'+data+'
'); } else if (data.indexOf('warning: ') != '-1') { @@ -174,7 +174,7 @@ data: frm.serialize(), type: frm.attr('method'), success: function( data ) { - data = data.replace('\n', '
'); + data = data.replace(/\n/g, "
"); if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') { toastr.clear(); toastr.error(data); @@ -205,7 +205,7 @@ data: frm.serialize() + "&nettools_action=" + $(this).val(), type: frm.attr('method'), success: function( data ) { - data = data.replace('\n', '
'); + data = data.replace(/\n/g, "
"); if (data.indexOf('error: ') != '-1' || data.indexOf('Fatal') != '-1' || data.indexOf('Error(s)') != '-1') { toastr.clear(); toastr.error(data); diff --git a/app/templates/ovw.html b/app/templates/ovw.html index 96ca145e..a34283d9 100644 --- a/app/templates/ovw.html +++ b/app/templates/ovw.html @@ -252,7 +252,7 @@ {% if grafana|int() >= 1 %} - Grafana + Grafana {% else %} Grafana diff --git a/inc/add.js b/inc/add.js index 9d87786a..01509afc 100644 --- a/inc/add.js +++ b/inc/add.js @@ -1985,7 +1985,9 @@ function showUserlists() { $('#existing_userlist_ajax').text(''); data = data.split(","); for (i = 0; i < data.length; i++) { - $('#existing_userlist_ajax').append(''+data[i]+' '); + var existing_userlist_ajax = $.find("#existing_userlist_ajax"); + existing_userlist_ajax = existing_userlist_ajax[0].id; + $('#'+existing_userlist_ajax).append(''+data[i]+' '); } } } diff --git a/inc/configshow.js b/inc/configshow.js index 3f9c16f6..ce3e358a 100644 --- a/inc/configshow.js +++ b/inc/configshow.js @@ -61,7 +61,7 @@ $( function() { data: frm.serialize() + "&save=" + $(this).val(), type: frm.attr('method'), success: function( data ) { - data = data.replace('\n', '
'); + data = data.replaceAll('\n', '
'); if (data.indexOf(service + ': command not found') != '-1') { try { var service = findGetParameter('service'); diff --git a/inc/script.js b/inc/script.js index c681214f..536416ef 100644 --- a/inc/script.js +++ b/inc/script.js @@ -127,14 +127,16 @@ if(localStorage.getItem('restart')) { type: "POST", success: function( data ) { if(data.indexOf('ok') != '-1') { + var apply_div = $.find("#apply_div"); + apply_div = apply_div[0].id; $("#apply").css('display', 'block'); - $("#apply_div").css('width', '850px'); + $('#'+apply_div).css('width', '850px'); if (cur_url[0] == "hapservers.py") { - $("#apply_div").css('width', '650px'); - $("#apply_div").addClass("alert-one-row"); - $("#apply_div").html("You have made changes to the server: "+ip_for_restart+". Changes will take effect only afterrestartX"); + $('#'+apply_div).css('width', '650px'); + $('#'+apply_div).addClass("alert-one-row"); + $('#'+apply_div).html("You have made changes to the server: "+ip_for_restart+". Changes will take effect only afterrestartX"); } else { - $("#apply_div").html("You have made changes to the server: "+ip_for_restart+". Changes will take effect only after restart. Go to the HAProxy Overview page and restartX"); + $('#'+apply_div).html("You have made changes to the server: "+ip_for_restart+". Changes will take effect only after restart. Go to the HAProxy Overview page and restartX"); } $.getScript('/inc/overview.js'); } @@ -901,7 +903,7 @@ $( function() { $('#auth').submit(function() { let searchParams = new URLSearchParams(window.location.search) if(searchParams.has('ref')) { - var ref = searchParams.get('ref'); + window.location = /.*ref=([^&]*).*/.exec(document.location.href)[1]; } else { var ref = "overview.py"; }