mirror of https://github.com/Aidaho12/haproxy-wi
v7.2.2.0: Update paths in waf.js file
The paths for waf.js and the loading image in waf.js have been updated to point to the correct locations. Also, unnecessary code related to the AJAX calls for metrics and installation has been removed, simplifying the code structure.pull/377/head
parent
fd0f0f194b
commit
4441a6e0b7
|
@ -1,5 +1,5 @@
|
||||||
var awesome = "/inc/fontawesome.min.js"
|
var awesome = "/inc/fontawesome.min.js"
|
||||||
var waf = "/static/js/waf.js"
|
var waf = "/app/static/js/waf.js"
|
||||||
var overview = "/inc/overview.js"
|
var overview = "/inc/overview.js"
|
||||||
function showOverviewWaf(serv, hostnamea) {
|
function showOverviewWaf(serv, hostnamea) {
|
||||||
var service = cur_url[1];
|
var service = cur_url[1];
|
||||||
|
@ -18,12 +18,8 @@ function showOverviewWafCallBack(serv, hostnamea) {
|
||||||
var service = cur_url[1];
|
var service = cur_url[1];
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/app/waf/overview/" + service + "/" + serv,
|
url: "/app/waf/overview/" + service + "/" + serv,
|
||||||
// data: {
|
|
||||||
// token: $('#token').val()
|
|
||||||
// },
|
|
||||||
// type: "POST",
|
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
$("#" + hostnamea).html('<img class="loading_small" src="/static/images/loading.gif" />');
|
$("#" + hostnamea).html('<img class="loading_small" src="/app/static/images/loading.gif" />');
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#" + hostnamea).empty();
|
$("#" + hostnamea).empty();
|
||||||
|
@ -43,10 +39,6 @@ function metrics_waf(name) {
|
||||||
name = name.split('metrics')[1]
|
name = name.split('metrics')[1]
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url: "/app/waf/metric/enable/" + enable + "/" + name,
|
url: "/app/waf/metric/enable/" + enable + "/" + name,
|
||||||
// data: {
|
|
||||||
// token: $('#token').val()
|
|
||||||
// },
|
|
||||||
// type: "POST",
|
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
showOverviewWaf(ip, hostnamea);
|
showOverviewWaf(ip, hostnamea);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -61,12 +53,8 @@ function installWaf(ip1) {
|
||||||
var service = cur_url[1];
|
var service = cur_url[1];
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/app/install/waf/" + service + "/" + ip1,
|
url: "/app/install/waf/" + service + "/" + ip1,
|
||||||
// data: {
|
|
||||||
// token: $('#token').val()
|
|
||||||
// },
|
|
||||||
type: "POST",
|
type: "POST",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
data = data.replace(/\s+/g, ' ');
|
|
||||||
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1' || data.indexOf('fatal') != '-1') {
|
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1' || data.indexOf('fatal') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else if (data.indexOf('Info') != '-1') {
|
} else if (data.indexOf('Info') != '-1') {
|
||||||
|
|
Loading…
Reference in New Issue