mirror of https://github.com/Aidaho12/haproxy-wi
parent
c1f3fe4a97
commit
d19ddc23eb
|
@ -147,7 +147,11 @@ function loadMetrics() {
|
|||
},
|
||||
type: "POST",
|
||||
success: function (data) {
|
||||
$( "#table_metrics" ).html( data );
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#table_metrics").html(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -166,7 +170,6 @@ function getChartDataHapWiRam(ip) {
|
|||
success: function (result) {
|
||||
var data = [];
|
||||
data.push(result.chartData.rams);
|
||||
|
||||
renderChartHapWiRam(data);
|
||||
}
|
||||
});
|
||||
|
@ -227,7 +230,6 @@ function getChartDataHapWiCpu(ip) {
|
|||
success: function (result) {
|
||||
var data = [];
|
||||
data.push(result.chartData.cpus);
|
||||
|
||||
renderChartHapWiCpu(data);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -24,8 +24,12 @@ function showHapserversCallBack(serv, hostnamea, service) {
|
|||
},
|
||||
type: "POST",
|
||||
success: function( data ) {
|
||||
$("#"+hostnamea).empty();
|
||||
$("#"+hostnamea).html(data);
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#" + hostnamea).empty();
|
||||
$("#" + hostnamea).html(data);
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -43,8 +47,12 @@ function overviewHapserverBackends(serv, hostnamea, service) {
|
|||
},
|
||||
type: "POST",
|
||||
success: function( data ) {
|
||||
$("#top-"+hostnamea).empty();
|
||||
$("#top-"+hostnamea).html(data);
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#top-" + hostnamea).empty();
|
||||
$("#top-" + hostnamea).html(data);
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -69,8 +77,12 @@ function showOverviewCallBack(serv, hostnamea) {
|
|||
},
|
||||
type: "POST",
|
||||
success: function( data ) {
|
||||
$("#"+hostnamea).empty();
|
||||
$("#"+hostnamea).html(data);
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#" + hostnamea).empty();
|
||||
$("#" + hostnamea).html(data);
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -88,21 +100,25 @@ function showOverviewServer(name,ip,id, service) {
|
|||
},
|
||||
type: "POST",
|
||||
success: function( data ) {
|
||||
$("#ajax-server-"+id).empty();
|
||||
$("#ajax-server-"+id).css('display', 'block');
|
||||
$("#ajax-server-"+id).css('background-color', '#fbfbfb');
|
||||
$("#ajax-server-"+id).css('border', '1px solid #A4C7F5');
|
||||
$(".ajax-server").css('display', 'block');
|
||||
$(".div-server").css('clear', 'both');
|
||||
$(".div-pannel").css('clear', 'both');
|
||||
$(".div-pannel").css('display', 'block');
|
||||
$(".div-pannel").css('padding-top', '10px');
|
||||
$(".div-pannel").css('height', '70px');
|
||||
$("#div-pannel-"+id).insertBefore('#up-pannel')
|
||||
$("#ajax-server-"+id).html(data);
|
||||
$.getScript("/inc/fontawesome.min.js")
|
||||
getChartDataHapWiRam()
|
||||
getChartDataHapWiCpu()
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#ajax-server-" + id).empty();
|
||||
$("#ajax-server-" + id).css('display', 'block');
|
||||
$("#ajax-server-" + id).css('background-color', '#fbfbfb');
|
||||
$("#ajax-server-" + id).css('border', '1px solid #A4C7F5');
|
||||
$(".ajax-server").css('display', 'block');
|
||||
$(".div-server").css('clear', 'both');
|
||||
$(".div-pannel").css('clear', 'both');
|
||||
$(".div-pannel").css('display', 'block');
|
||||
$(".div-pannel").css('padding-top', '10px');
|
||||
$(".div-pannel").css('height', '70px');
|
||||
$("#div-pannel-" + id).insertBefore('#up-pannel')
|
||||
$("#ajax-server-" + id).html(data);
|
||||
$.getScript("/inc/fontawesome.min.js")
|
||||
getChartDataHapWiRam()
|
||||
getChartDataHapWiCpu()
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
@ -119,7 +135,7 @@ function ajaxActionServers(action, id) {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if( data == 'Bad config, check please ' ) {
|
||||
alert(data);
|
||||
toastr.error(data);
|
||||
} else {
|
||||
if (cur_url[0] == "hapservers.py") {
|
||||
location.reload()
|
||||
|
@ -171,7 +187,7 @@ function ajaxActionWafServers(action, id) {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if( data == 'Bad config, check please ' ) {
|
||||
alert(data);
|
||||
toastr.error(data);
|
||||
} else {
|
||||
setTimeout(showOverviewWaf(ip, hostnamea), 2000)
|
||||
}
|
||||
|
@ -290,11 +306,7 @@ function updateHapWIServer(id) {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
$("#ajax-servers").append(data);
|
||||
$('#errorMess').click(function() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
});
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$('.alert-danger').remove();
|
||||
$("#server-"+id).addClass( "update", 1000 );
|
||||
|
@ -318,3 +330,26 @@ function change_pos(pos, id) {
|
|||
}
|
||||
} );
|
||||
}
|
||||
function showBytes(serv) {
|
||||
$.ajax( {
|
||||
url: "options.py",
|
||||
data: {
|
||||
showBytes: serv,
|
||||
token: $('#token').val()
|
||||
},
|
||||
type: "POST",
|
||||
beforeSend: function() {
|
||||
$("#show_bin_bout").html('<img class="loading_small_bin_bout" src="/inc/images/loading.gif" />');
|
||||
$("#sessions").html('<img class="loading_small_bin_bout" src="/inc/images/loading.gif" />');
|
||||
},
|
||||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#bin_bout").html(data);
|
||||
$.getScript("/inc/fontawesome.min.js")
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@ $( function() {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
$("#ajaxmaxconn").html('<div class="alert alert-danger" style="margin: 10px;">'+data+'</div>');
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#ajaxmaxconn").html('<div class="alert alert-success" style="margin: 10px;">'+data+'</div>');
|
||||
toastr.success(data);
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
@ -182,9 +182,9 @@ $( function() {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
$("#ajaxip").html('<div class="alert alert-danger" style="margin: 10px;">'+data+'</div>');
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#ajaxip").html('<div class="alert alert-success" style="margin: 10px;">'+data+'</div>');
|
||||
toastr.success(data);
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
@ -202,7 +202,7 @@ $( function() {
|
|||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,'');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
alert(data)
|
||||
toastr.error(data);
|
||||
} else {
|
||||
var value = data.split(',')
|
||||
$('#table_select').find('option').remove();
|
||||
|
@ -245,8 +245,7 @@ $( function() {
|
|||
});
|
||||
});
|
||||
function deleteTableEntry(id, table, ip) {
|
||||
console.log(table)
|
||||
console.log(ip)
|
||||
$(id).parent().parent().css("background-color", "#f2dede");
|
||||
$.ajax( {
|
||||
url: "options.py",
|
||||
data: {
|
||||
|
@ -258,7 +257,7 @@ function deleteTableEntry(id, table, ip) {
|
|||
type: "POST",
|
||||
success: function( data ) {
|
||||
if (data.indexOf('error') != '-1') {
|
||||
alert(data);
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$(id).parent().parent().remove()
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
<script src="/inc/codemirror/codemirror.js"></script>
|
||||
<script src="/inc/codemirror/nginx.js"></script>
|
||||
<script src="/inc/codemirror/haproxy.js"></script>
|
||||
<link href="/inc/toastr.css" rel="stylesheet"/>
|
||||
<script src="/inc/toastr.js"></script>
|
||||
<meta http-equiv="refresh" content="0; url=/app/overview.py" />
|
||||
</head>
|
||||
<body style="background-color: #239dee;">
|
||||
|
|
Loading…
Reference in New Issue