pull/98/head
Aidaho12 6 years ago
parent 3389529cc6
commit bb2dfcd993

@ -38,6 +38,7 @@ Began to lead a [Twitter](https://twitter.com/haproxy_wi), subscribe! I will wri
23. Web acceleration settings 23. Web acceleration settings
24. Web application firewall 24. Web application firewall
25. LDAP support 25. LDAP support
26. Keep active HAProxy service
![alt text](image/haproxy-wi-metrics.jpeg "Merics") ![alt text](image/haproxy-wi-metrics.jpeg "Merics")

@ -477,6 +477,7 @@ function addServer() {
var enable = 0; var enable = 0;
var alert_en = 0; var alert_en = 0;
var metrics = 0; var metrics = 0;
var active = 0;
if ($('#typeip').is(':checked')) { if ($('#typeip').is(':checked')) {
typeip = '1'; typeip = '1';
} }
@ -489,6 +490,9 @@ function addServer() {
if ($('#metrics').is(':checked')) { if ($('#metrics').is(':checked')) {
var metrics = '1'; var metrics = '1';
} }
if ($('#active').is(':checked')) {
var active = '1';
}
allFields = $( [] ).add( $('#new-server-add') ).add( $('#new-ip') ).add( $('#new-port') ) allFields = $( [] ).add( $('#new-server-add') ).add( $('#new-ip') ).add( $('#new-port') )
allFields.removeClass( "ui-state-error" ); allFields.removeClass( "ui-state-error" );
valid = valid && checkLength( $('#new-server-add'), "Hostname", 1 ); valid = valid && checkLength( $('#new-server-add'), "Hostname", 1 );
@ -510,7 +514,8 @@ function addServer() {
alert_en: alert_en, alert_en: alert_en,
metrics: metrics, metrics: metrics,
page: cur_url[0], page: cur_url[0],
desc: $('#desc').val() desc: $('#desc').val(),
active: active
}, },
type: "GET", type: "GET",
success: function( data ) { success: function( data ) {
@ -758,6 +763,8 @@ function removeTelegram(id) {
} }
function updateUser(id) { function updateUser(id) {
$('.alert-danger').remove(); $('.alert-danger').remove();
cur_url[0] = cur_url[0].split('#')[0]
console.log(cur_url[0])
if (cur_url[0] != "servers.py") { if (cur_url[0] != "servers.py") {
var usergroup = $('#usergroup-'+id+' option:selected' ).val(); var usergroup = $('#usergroup-'+id+' option:selected' ).val();
} else { } else {
@ -828,6 +835,7 @@ function updateServer(id) {
var enable = 0; var enable = 0;
var alert_en = 0; var alert_en = 0;
var metrics = 0; var metrics = 0;
var active = 0;
if ($('#typeip-'+id).is(':checked')) { if ($('#typeip-'+id).is(':checked')) {
typeip = '1'; typeip = '1';
} }
@ -840,6 +848,9 @@ function updateServer(id) {
if ($('#metrics-'+id).is(':checked')) { if ($('#metrics-'+id).is(':checked')) {
metrics = '1'; metrics = '1';
} }
if ($('#active-'+id).is(':checked')) {
active = '1';
}
var servergroup = $('#servergroup-'+id+' option:selected' ).val(); var servergroup = $('#servergroup-'+id+' option:selected' ).val();
if (cur_url[0] == "servers.py") { if (cur_url[0] == "servers.py") {
servergroup = $('#servergroup-'+id).val(); servergroup = $('#servergroup-'+id).val();
@ -858,7 +869,8 @@ function updateServer(id) {
id: id, id: id,
metrics: metrics, metrics: metrics,
alert_en: alert_en, alert_en: alert_en,
desc: $('#desc-'+id).val() desc: $('#desc-'+id).val(),
active: active
}, },
type: "GET", type: "GET",
success: function( data ) { success: function( data ) {

Loading…
Cancel
Save