Pavel Loginov 2020-07-30 19:28:58 +02:00
parent a0aaab0efe
commit 69b33495d7
9 changed files with 109 additions and 125 deletions

View File

@ -129,9 +129,6 @@
{% endif %}
</ul>
</nav>
<div class="donate-menu">
<a href="https://haproxy-wi.org/donate.py" title="Donate" target="_blank" style="color: #fff; margin-left: -10px; color: red;" class="patreon"> Donate</a>
</div>
</div>
</div>
<div id="cover"></div>

View File

@ -1,11 +1,7 @@
var ssl_offloading_var = "http-request set-header X-Forwarded-Port %[dst_port] \n"+
"http-request add-header X-Forwarded-Proto https if { ssl_fc } \n"+
"redirect scheme https if !{ ssl_fc } \n"
$( function() {
$('#close').click(function(){
$('.alert-success').remove();
$('.alert-danger').remove();
});
$( function() {
$( "#listen-mode-select" ).on('selectmenuchange',function() {
if ($( "#listen-mode-select option:selected" ).val() == "tcp") {
$( "#https-listen-span" ).hide("fast");
@ -419,8 +415,6 @@ $( function() {
}
});
$('#add-option-new').click(function() {
$('#error').remove();
$('.alert-danger').remove();
$.ajax( {
url: "sql.py",
@ -431,12 +425,8 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
$("#ajax-option").append(data);
$('#errorMess').click(function() {
$('#error').remove();
$('.alert-danger').remove();
});
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#option_table").append(data);
setTimeout(function() {
@ -472,8 +462,6 @@ $( function() {
}
});
$('#add-saved-server-new').click(function() {
$('#error').remove();
$('.alert-danger').remove();
$.ajax( {
url: "sql.py",
@ -485,12 +473,8 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
$("#ajax-option").append(data);
$('#errorMess').click(function() {
$('#error').remove();
$('.alert-danger').remove();
});
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#servers_table").append(data);
setTimeout(function() {
@ -579,7 +563,7 @@ $( function() {
if($('#name').val() == "") {
$("#optionsInput").append(ddos_var)
}
var ddos_var = "#Start config for DDOS atack protecte\n"+
var ddos_var = "#Start config for DDOS atack protect\n"+
"stick-table type ip size 1m expire 1m store gpc0,http_req_rate(10s),http_err_rate(10s)\n"+
"tcp-request connection track-sc1 src\n"+
"tcp-request connection reject if { sc1_get_gpc0 gt 0 }\n"+
@ -602,7 +586,7 @@ $( function() {
if($('#new_frontend').val() == "") {
$("#optionsInput1").append(ddos_var)
}
var ddos_var = "#Start config for DDOS atack protecte\n"+
var ddos_var = "#Start config for DDOS atack protect\n"+
"stick-table type ip size 1m expire 1m store gpc0,http_req_rate(10s),http_err_rate(10s)\n"+
"tcp-request connection track-sc1 src\n"+
"tcp-request connection reject if { sc1_get_gpc0 gt 0 }\n"+
@ -752,7 +736,6 @@ $( function() {
minLength: -1
});
$( "#ssl_key_upload" ).click(function() {
$('.alert-danger').remove();
$.ajax( {
url: "options.py",
data: {
@ -764,13 +747,12 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('danger') != '-1') {
$("#ajax-ssl").html(data);
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else if (data.indexOf('success') != '-1') {
$('.alert-danger').remove();
$( "#ajax-ssl").html(data);
toastr.success(data);
} else {
$("#ajax-ssl").html('<div class="alert alert-danger">Something wrong, check and try again</div>');
toastr.error('Something wrong, check and try again');
}
}
} );
@ -785,10 +767,9 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('danger') != '-1') {
$("#ajax-show-ssl").html(data);
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$('.alert-danger').remove();
var i;
var new_data = "";
data = data.split("\n");
@ -982,7 +963,7 @@ function removeOption(id) {
} );
}
function updateOptions(id) {
$('#error').remove();
toastr.clear();
$.ajax( {
url: "sql.py",
data: {
@ -993,14 +974,9 @@ function updateOptions(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
$("#ajax-ssh").append(data);
$('#errorMess').click(function() {
$('#error').remove();
$('.alert-danger').remove();
});
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$('.alert-danger').remove();
$("#option-"+id).addClass( "update", 1000 );
setTimeout(function() {
$( "#option-"+id ).removeClass( "update" );
@ -1045,7 +1021,7 @@ function removeSavedServer(id) {
} );
}
function updateSavedServer(id) {
$('#error').remove();
toastr.clear();
$.ajax( {
url: "sql.py",
data: {
@ -1057,14 +1033,9 @@ function updateSavedServer(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
$("#ajax-ssh").append(data);
$('#errorMess').click(function() {
$('#error').remove();
$('.alert-danger').remove();
});
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$('.alert-danger').remove();
$("#option-"+id).addClass( "update", 1000 );
setTimeout(function() {
$( "#option-"+id ).removeClass( "update" );
@ -1083,10 +1054,9 @@ function view_ssl(id) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('danger') != '-1') {
$("#ajax-show-ssl").html(data);
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$('.alert-danger').remove();
$('#dialog-confirm-body').text(data);
$( "#dialog-confirm-cert" ).dialog({
resizable: false,
@ -1156,10 +1126,19 @@ function createList(color) {
},
type: "POST",
success: function( data ) {
$("#ajax").html(data);
setTimeout(function() {
location.reload();
}, 2500 );
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else if (data.indexOf('Info') != '-1' ){
toastr.clear();
toastr.info(data);
} else if (data.indexOf('success') != '-1' ) {
toastr.clear();
toastr.success('WAF service has installed');
showOverviewWaf(ip, hostnamea)
setTimeout(function () {
location.reload();
}, 2500);
}
}
} );
}
@ -1174,10 +1153,9 @@ function editList(list, color) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('danger') != '-1') {
$("#ajax").html(data);
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$('.alert-danger').remove();
$('#edit_lists').text(data);
$( "#dialog-confirm-cert-edit" ).dialog({
resizable: false,
@ -1221,7 +1199,17 @@ function saveList(action, list, color) {
},
type: "POST",
success: function( data ) {
$("#ajax").html(data);
data = data.split(" , ");
for (i = 0; i < data.length; i++) {
if (data[i]) {
if (data[i].indexOf('error:') != '-1') {
toastr.error(data[i]);
} else {
toastr.success(data[i]);
}
}
}
}
} );
}

View File

@ -147,7 +147,7 @@ function loadMetrics() {
},
type: "POST",
success: function (data) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#table_metrics").html(data);

View File

@ -24,7 +24,7 @@ function showHapserversCallBack(serv, hostnamea, service) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#" + hostnamea).empty();
@ -47,7 +47,7 @@ function overviewHapserverBackends(serv, hostnamea, service) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#top-" + hostnamea).empty();
@ -77,7 +77,7 @@ function showOverviewCallBack(serv, hostnamea) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#" + hostnamea).empty();
@ -100,7 +100,7 @@ function showOverviewServer(name,ip,id, service) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#ajax-server-" + id).empty();
@ -305,7 +305,7 @@ function updateHapWIServer(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -344,7 +344,7 @@ function showBytes(serv) {
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#bin_bout").html(data);

View File

@ -34,7 +34,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
alert(data)
} else {
var value = data.split('<br>')
@ -66,7 +66,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.success(data);
@ -86,7 +86,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
alert(data)
} else {
var value = data.split('<br>')
@ -119,7 +119,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
alert(data)
} else {
var value = data.split('<br>')
@ -154,7 +154,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
alert(data)
} else {
var server = data.split(':')[0]
@ -181,7 +181,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.success(data);
@ -201,7 +201,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,'');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
var value = data.split(',')
@ -231,7 +231,7 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
$("#ajaxtable").html(data);
} else {
$("#ajaxtable").html(data);
@ -256,7 +256,7 @@ function deleteTableEntry(id, table, ip) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$(id).parent().parent().remove()

View File

@ -283,7 +283,7 @@ function showStats() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -349,7 +349,7 @@ function showLog() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -382,7 +382,7 @@ function showMap() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -404,7 +404,7 @@ function showCompare() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -428,7 +428,7 @@ function showCompareConfigs() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -456,7 +456,7 @@ function showConfig() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -482,7 +482,7 @@ function showUploadConfig() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1049,7 +1049,7 @@ function showSmon(action) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('SMON error') != '-1') {
if (data.indexOf('SMON error:') != '-1') {
toastr.error(data);
} else {
$("#smon_dashboard").html(data);

View File

@ -77,7 +77,7 @@ pre {
margin-bottom: 0px;
}
.top-menu {
position: absolute;
position: fixed;
min-height: calc(99vh - 50px);
height: 120%;
width: 207px;
@ -289,7 +289,7 @@ pre {
.paramInSec {
font-weight: bold;
}
.donate-menu {
/*.donate-menu {
font-weight: bold;
font-style: italic;
font-size: 15px;
@ -298,7 +298,7 @@ pre {
position: fixed;
margin-left: 65px;
margin-top: 15px;
}
}*/
.line {
background-color: #f3f8fb;
border: 1px solid #ddd;

View File

@ -25,7 +25,7 @@ $( function() {
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else {
response(data.split(" "));
@ -47,7 +47,7 @@ $( function() {
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else {
response(data.split(" "));
@ -98,7 +98,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('alert') != '-1' || data.indexOf('FAILED') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('alert') != '-1' || data.indexOf('FAILED') != '-1') {
toastr.error(data);
} else if (data.indexOf('info') != '-1' ){
toastr.clear();
@ -142,7 +142,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.clear();
toastr.error(data);
} else if (data.indexOf('success') != '-1'){
@ -174,7 +174,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('FAILED') != '-1') {
toastr.error(data);
} else if (data.indexOf('success') != '-1' ){
toastr.remove();
@ -206,7 +206,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('FAILED') != '-1') {
toastr.clear();
toastr.error(data);
} else if (data.indexOf('success') != '-1' ){
@ -262,7 +262,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('FAILED') != '-1') {
toastr.clear();
toastr.error(data);
} else if (data.indexOf('success') != '-1' ){
@ -292,7 +292,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('FAILED') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('FAILED') != '-1') {
toastr.error(data);
} else if (data.indexOf('success') != '-1' ){
toastr.clear();
@ -414,7 +414,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else if (data.indexOf('Complete!') != '-1'){
toastr.clear();
@ -465,7 +465,7 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -498,7 +498,7 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -533,7 +533,7 @@ $( function() {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
$("#checker_table").append(data);
@ -754,7 +754,7 @@ $( function() {
});
$('#search_ldap_user').click(function() {
var valid = true;
$('#error').remove();
toastr.clear();
allFields = $( [] ).add( $('#new-username') )
allFields.removeClass( "ui-state-error" );
valid = valid && checkLength( $('#new-username'), "user name", 1 );
@ -769,7 +769,7 @@ $( function() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
$('#new-email').val('');
$('#new-password').attr('readonly', false);
@ -811,7 +811,6 @@ function checkLength( o, n, min ) {
}
function addNewSmonServer() {
var valid = true;
$('#error').remove();
allFields = $( [] ).add( $('#new-smon-ip') ).add( $('#new-smon-port') )
allFields.removeClass( "ui-state-error" );
valid = valid && checkLength( $('#new-smon-ip'), "IP", 1 );
@ -857,7 +856,7 @@ function addNewSmonServer() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('unique') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('unique') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -880,7 +879,7 @@ function addNewSmonServer() {
}
function addUser() {
var valid = true;
$('#error').remove();
toastr.clear();
allFields = $( [] ).add( $('#new-username') ).add( $('#new-password') )
allFields.removeClass( "ui-state-error" );
valid = valid && checkLength( $('#new-username'), "user name", 1 );
@ -906,10 +905,10 @@ function addUser() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.remove();
toastr.clear();
$("#ajax-users").append(data);
var getId = new RegExp('[0-9]+');
var id = data.match(getId);
@ -971,7 +970,7 @@ function addServer() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear()
@ -994,7 +993,7 @@ function addServer() {
}
function addBackup() {
var valid = true;
$('#error').remove();
toastr.clear();
allFields = $( [] ).add( $('#backup-server') ).add( $('#rserver') ).add( $('#rpath') ).add( $('#backup-time') ).add( $('#backup-credentials') )
allFields.removeClass( "ui-state-error" );
valid = valid && checkLength( $('#backup-server'), "backup server ", 1 );
@ -1019,7 +1018,7 @@ function addBackup() {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else if (data.indexOf('success') != '-1') {
toastr.remove();
@ -1052,7 +1051,7 @@ function updateSettings(param, val) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1427,7 +1426,7 @@ function updateUser(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.remove();
@ -1452,7 +1451,7 @@ function updateGroup(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1507,7 +1506,7 @@ function updateServer(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1571,7 +1570,7 @@ function updateSSH(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1601,7 +1600,7 @@ function updateTelegram(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1634,7 +1633,7 @@ function updateBackup(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1670,7 +1669,7 @@ function updateSmon(id) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1725,7 +1724,7 @@ function checkSshConnect(ip) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data)
} else {
toastr.clear();
@ -1774,7 +1773,7 @@ function changeUserPassword(id, d) {
$('#missmatchpass').show();
} else {
$('#missmatchpass').hide();
$('#error').remove();
toastr.clear();
$.ajax( {
url: "options.py",
data: {
@ -1785,7 +1784,7 @@ function changeUserPassword(id, d) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1') {
if (data.indexOf('error:') != '-1') {
toastr.error(data);
} else {
toastr.clear();
@ -1845,7 +1844,7 @@ function changeUserGroup(id) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else {
$("#user-" + id).addClass("update", 1000);
@ -1867,7 +1866,7 @@ function addUserGroup(id) {
},
type: "POST",
success: function( data ) {
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else {
$("#user-" + id).addClass("update", 1000);

View File

@ -65,7 +65,7 @@ function installWaf(ip1) {
type: "POST",
success: function( data ) {
data = data.replace(/\s+/g,' ');
if (data.indexOf('error') != '-1' || data.indexOf('Failed') != '-1') {
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
toastr.error(data);
} else if (data.indexOf('Info') != '-1' ){
toastr.clear();