Start typing options:
- {{ input('options2') }}
+ {{ input('options1') }}
or press down. Read more about options
diff --git a/app/tools/checker_worker.py b/app/tools/checker_worker.py
index 2bf0324b..c0e06c28 100644
--- a/app/tools/checker_worker.py
+++ b/app/tools/checker_worker.py
@@ -40,6 +40,7 @@ def main(serv, port):
firstrun = False
old_stat_service = cur_stat_service
+ time.sleep(60)
continue
except OSError as e:
print(e)
diff --git a/inc/add.js b/inc/add.js
index 5f9504f6..7a643839 100644
--- a/inc/add.js
+++ b/inc/add.js
@@ -222,7 +222,7 @@ $( function() {
var availableTags = [
- "acl", "http-request", "http-response", "set-uri", "set-url", "set-header", "add-header", "del-header", "replace-header", "path_beg", "url_beg()", "urlp_sub()", "set cookie", "dynamic-cookie-key", "mysql-check", "tcpka", "tcplog", "forwardfor", "option"
+ "acl", "hdr(host)", "hdr_beg(host)", "hdr_dom(host)", "http-request", "http-response", "set-uri", "set-url", "set-header", "add-header", "del-header", "replace-header", "path_beg", "url_beg()", "urlp_sub()", "set cookie", "dynamic-cookie-key", "mysql-check", "tcpka", "tcplog", "forwardfor", "option"
];
$( "#ip" ).autocomplete({
@@ -355,7 +355,8 @@ $( function() {
minLength: -1,
select: function( event, ui ) {
$("#optionsInput").append(ui.item.value + " ");
- $("#options").empty();
+ $(this).val('');
+ return false;
}
});
$( "#saved-options" ).autocomplete({
@@ -365,8 +366,8 @@ $( function() {
minLength: 1,
select: function( event, ui ) {
$("#optionsInput").append(ui.item.value + " \n");
- $(this).val('');
- $(this).autocomplete( "close" );
+ $(this).val('');
+ return false;
}
});
$( "#options1" ).autocomplete({
@@ -374,9 +375,12 @@ $( function() {
autoFocus: true,
minLength: -1,
select: function( event, ui ) {
- $("#optionsInput1").append(ui.item.value + " ")
+ $("#optionsInput1").append(ui.item.value + " ");
+ $(this).val('');
+ return false;
}
});
+
$( "#saved-options1" ).autocomplete({
dataType: "json",
source: "sql.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
@@ -384,8 +388,8 @@ $( function() {
minLength: 1,
select: function( event, ui ) {
$("#optionsInput1").append(ui.item.value + " \n");
- $(this).val('');
- $(this).autocomplete( "close" );
+ $(this).val('');
+ return false;
}
});
$( "#options2" ).autocomplete({
@@ -393,7 +397,9 @@ $( function() {
autoFocus: true,
minLength: -1,
select: function( event, ui ) {
- $("#optionsInput2").append(ui.item.value + " ")
+ $("#optionsInput2").append(ui.item.value + " ");
+ $(this).val('');
+ return false;
}
});
$( "#saved-options2" ).autocomplete({
@@ -403,8 +409,8 @@ $( function() {
minLength: 1,
select: function( event, ui ) {
$("#optionsInput2").append(ui.item.value + " \n");
- $(this).val('');
- $(this).autocomplete( "close" );
+ $(this).val('');
+ return false;
}
});
$('#add-option-button').click(function() {
diff --git a/inc/overview.js b/inc/overview.js
index 6c04672d..ed26ee22 100644
--- a/inc/overview.js
+++ b/inc/overview.js
@@ -287,6 +287,7 @@ function updateHapWIServer(id) {
url: "options.py",
data: {
updatehapwiserver: id,
+ name: $('#server-name-'+id).val(),
metrics: metrics,
alert_en: alert_en,
active: active,
diff --git a/inc/script.js b/inc/script.js
index 5a62d5df..a1c0dae8 100644
--- a/inc/script.js
+++ b/inc/script.js
@@ -409,6 +409,7 @@ function showCompareConfigs() {
} );
}
function showConfig() {
+ var service = $('#service').val();
$("#ajax").empty();
$("#ajax-compare").empty();
$("#config").empty();
@@ -418,13 +419,14 @@ function showConfig() {
data: {
serv: $("#serv").val(),
act: "configShow",
+ service: service,
token: $('#token').val()
},
type: "POST",
success: function( data ) {
$("#ajax").html(data);
$.getScript('/inc/configshow.js');
- window.history.pushState("Show config", "Show config", cur_url[0]+'?serv='+$("#serv").val()+'&showConfig');
+ window.history.pushState("Show config", "Show config", cur_url[0]+"?service="+service+"&serv="+$("#serv").val()+"&showConfig");
}
} );
}
@@ -819,53 +821,6 @@ $( function() {
} );
}
}
- $( "#haproxyaddserv" ).on('selectmenuchange',function() {
- $.ajax( {
- url: "options.py",
- data: {
- get_hap_v: 1,
- serv: $('#haproxyaddserv option:selected').val(),
- token: $('#token').val()
- },
- type: "POST",
- success: function( data ) {
- data = data.replace(/^\s+|\s+$/g,'');
- if(data != '') {
- data = data+'-1';
- $('#cur_hap_ver').text(data);
- $('#install').text('Update');
- $('#install').attr('title', 'Update HAProxy');
- } else {
- $('#cur_hap_ver').text('HAProxy has not installed');
- $('#install').text('Install');
- $('#install').attr('title', 'Install HAProxy');
- }
- }
- } );
- });
- $( "#nginxaddserv" ).on('selectmenuchange',function() {
- $.ajax( {
- url: "options.py",
- data: {
- get_nginx_v: 1,
- serv: $('#nginxaddserv option:selected').val(),
- token: $('#token').val()
- },
- type: "POST",
- success: function( data ) {
- data = data.replace(/^\s+|\s+$/g,'');
- if(data.indexOf('bash') != '-1') {
- $('#cur_nginx_ver').text('Nginx has not installed');
- $('#nginx_install').text('Install');
- $('#nginx_install').attr('title', 'Install Nginx');
- } else {
- $('#cur_nginx_ver').text(data);
- $('#nginx_install').text('Update');
- $('#nginx_install').attr('title', 'Update Nginx');
- }
- }
- } );
- });
});
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
diff --git a/inc/users.js b/inc/users.js
index 5ef99185..4e6c1b3a 100644
--- a/inc/users.js
+++ b/inc/users.js
@@ -313,6 +313,101 @@ $( function() {
}
} );
});
+ $( "#haproxyaddserv" ).on('selectmenuchange',function() {
+ $.ajax( {
+ url: "options.py",
+ data: {
+ get_hap_v: 1,
+ serv: $('#haproxyaddserv option:selected').val(),
+ token: $('#token').val()
+ },
+ type: "POST",
+ success: function( data ) {
+ data = data.replace(/^\s+|\s+$/g,'');
+ if(data != '') {
+ data = data+'-1';
+ $('#cur_hap_ver').text(data);
+ $('#install').text('Update');
+ $('#install').attr('title', 'Update HAProxy');
+ } else {
+ $('#cur_hap_ver').text('HAProxy has not installed');
+ $('#install').text('Install');
+ $('#install').attr('title', 'Install HAProxy');
+ }
+ }
+ } );
+ });
+ $( "#nginxaddserv" ).on('selectmenuchange',function() {
+ $.ajax( {
+ url: "options.py",
+ data: {
+ get_nginx_v: 1,
+ serv: $('#nginxaddserv option:selected').val(),
+ token: $('#token').val()
+ },
+ type: "POST",
+ success: function( data ) {
+ data = data.replace(/^\s+|\s+$/g,'');
+ if(data.indexOf('bash') != '-1') {
+ $('#cur_nginx_ver').text('Nginx has not installed');
+ $('#nginx_install').text('Install');
+ $('#nginx_install').attr('title', 'Install Nginx');
+ } else {
+ $('#cur_nginx_ver').text(data);
+ $('#nginx_install').text('Update');
+ $('#nginx_install').attr('title', 'Update Nginx');
+ }
+ }
+ } );
+ });
+ $( "#haproxy_exp_addserv" ).on('selectmenuchange',function() {
+ $.ajax( {
+ url: "options.py",
+ data: {
+ get_exporter_v: 'haproxy_exporter',
+ serv: $('#haproxy_exp_addserv option:selected').val(),
+ token: $('#token').val()
+ },
+ type: "POST",
+ success: function( data ) {
+ data = data.replace(/^\s+|\s+$/g,'');
+ console.log(data)
+ if(data == 'Active:') {
+ $('#cur_haproxy_exp_ver').text('HAProxy expoter is installed');
+ $('#haproxy_exp_install').text('Update');
+ $('#haproxy_exp_install').attr('title', 'Update HAProxy expoter');
+ } else {
+ $('#cur_haproxy_exp_ver').text('HAProxy expoter has not installed');
+ $('#haproxy_exp_install').text('Install');
+ $('#haproxy_exp_install').attr('title', 'Install HAProxy expoter');
+ }
+ }
+ } );
+ });
+ $( "#nginx_exp_addserv" ).on('selectmenuchange',function() {
+ $.ajax( {
+ url: "options.py",
+ data: {
+ get_exporter_v: 'nginx_exporter',
+ serv: $('#nginx_exp_addserv option:selected').val(),
+ token: $('#token').val()
+ },
+ type: "POST",
+ success: function( data ) {
+ data = data.replace(/^\s+|\s+$/g,'');
+ console.log(data)
+ if(data == 'Active:') {
+ $('#cur_nginx_exp_ver').text('Nginx expoter is installed');
+ $('#nginx_exp_install').text('Update');
+ $('#nginx_exp_install').attr('title', 'Update Nginx expoter');
+ } else {
+ $('#cur_nginx_exp_ver').text('Nginx expoter has not installed');
+ $('#nginx_exp_install').text('Install');
+ $('#nginx_exp_install').attr('title', 'Install Nginx expoter');
+ }
+ }
+ } );
+ });
$('#update_haproxy_wi').click(function() {
$("#ajax-update").html('')
$("#ajax-update").html('
Please don\'t close and don\'t represh page. Wait until the work is completed. This may take some time
');
@@ -1419,7 +1514,7 @@ function updateTelegram(id) {
data: {
updatetoken: $('#telegram-token-'+id).val(),
updategchanel: $('#telegram-chanel-'+id).val(),
- updategroup: $('#telegramgroup-'+id).val(),
+ updatetelegramgroup: $('#telegramgroup-'+id).val(),
id: id,
token: $('#token').val()
},
@@ -1525,7 +1620,7 @@ function checkSshConnect(ip) {
},
type: "POST",
success: function( data ) {
- if (data.indexOf('danger') != '-1') {
+ if (data.indexOf('error') != '-1') {
$("#checkSshConnect").html(data);
} else {
$("#checkSshConnect").html("
");