From 1980fb6674d51d73f5ed6aa6e48dc2133d373a36 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sat, 12 Dec 2015 21:42:34 +0100 Subject: haproxy-devel, small fixes --- config/haproxy-devel/pkg/haproxy.inc | 9 ++++--- config/haproxy-devel/pkg/haproxy_socketinfo.inc | 6 ++++- config/haproxy-devel/www/haproxy_global.php | 29 ++++++++++++++-------- .../haproxy-devel/www/haproxy_listeners_edit.php | 16 +++++++++--- config/haproxy-devel/www/haproxy_pool_edit.php | 13 +++++++--- 5 files changed, 51 insertions(+), 22 deletions(-) (limited to 'config') diff --git a/config/haproxy-devel/pkg/haproxy.inc b/config/haproxy-devel/pkg/haproxy.inc index 3d614fe0..8dce42ee 100644 --- a/config/haproxy-devel/pkg/haproxy.inc +++ b/config/haproxy-devel/pkg/haproxy.inc @@ -43,7 +43,10 @@ $a_frontendmode = array(); $a_frontendmode['http'] = array('name' => "http / https(offloading)", 'shortname' => "http/https"); $a_frontendmode['https'] = array('name' => "ssl / https(TCP mode)", 'shortname' => "ssl/https"); $a_frontendmode['tcp'] = array('name' => "tcp", 'shortname' => "tcp"); -$a_frontendmode['health'] = array('name' => "health", 'shortname' => "health"); +/* + if anyone actually used this what was it good for with recent package versions? +$a_frontendmode['health'] = array('name' => "health", 'shortname' => "health"); +*/ global $a_acltypes; $a_acltypes = array(); @@ -1738,8 +1741,8 @@ function haproxy_writeconf($configpath) { if ($bind['forwardfor']) { fwrite ($fd, "\toption\t\t\tforwardfor\n"); fwrite ($fd, "\tacl https ssl_fc\n"); - fwrite ($fd, "\treqadd X-Forwarded-Proto:\ http if !https\n"); - fwrite ($fd, "\treqadd X-Forwarded-Proto:\ https if https\n"); + fwrite ($fd, "\thttp-request set-header\t\tX-Forwarded-Proto http if !https\n"); + fwrite ($fd, "\thttp-request set-header\t\tX-Forwarded-Proto https if https\n"); } } diff --git a/config/haproxy-devel/pkg/haproxy_socketinfo.inc b/config/haproxy-devel/pkg/haproxy_socketinfo.inc index cbfb131b..7dbb6221 100644 --- a/config/haproxy-devel/pkg/haproxy_socketinfo.inc +++ b/config/haproxy-devel/pkg/haproxy_socketinfo.inc @@ -40,14 +40,18 @@ $show_clients_traffic = "YES"; function haproxy_socket_command($command){ $result = array(); if (file_exists("/tmp/haproxy.socket")) { - $socket = stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr); + $socket = @stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr); if ($socket) { fwrite($socket, "$command\n"); while (!feof($socket)) { $result[] = fgets($socket); } fclose($socket); + } else { + echo "cannot open command socket, haproxy not running? ({$errstr})"; } + } else { + echo "haproxy command socket does not exist, haproxy not running?"; } return $result; } diff --git a/config/haproxy-devel/www/haproxy_global.php b/config/haproxy-devel/www/haproxy_global.php index 4902b966..ce6b249e 100644 --- a/config/haproxy-devel/www/haproxy_global.php +++ b/config/haproxy-devel/www/haproxy_global.php @@ -425,29 +425,29 @@ function enable_change(enable_change) { - 'resolver_retries' + Retries size="50"/>
- Email address to be used as the sender of the emails. + Defines the number of queries to send to resolve a server name before giving up. Default value: 3 - 'resolver_timeoutretry' + Retry timeout size="50"/>
- Email address to be used as the sender of the emails. + Time between two DNS queries, when no response have been received. Default value: 1s - 'resolver_holdvalid' + Interval size="50"/>
- Email address to be used as the sender of the emails. + Interval between two successive name resolution when the last answer was valid. Default value: 10s   @@ -612,13 +612,22 @@ Minimum and default value is: 1024, bigger values might increase CPU usage.
+ + +
+ Show automatically generated test configuration. +
+
diff --git a/config/haproxy-devel/www/haproxy_listeners_edit.php b/config/haproxy-devel/www/haproxy_listeners_edit.php index 8e6c1c3d..f26341b2 100644 --- a/config/haproxy-devel/www/haproxy_listeners_edit.php +++ b/config/haproxy-devel/www/haproxy_listeners_edit.php @@ -532,8 +532,9 @@ $primaryfrontends = get_haproxy_frontends($excludefrontend); d = document; for (i = 0; i < 99; i++) { el = d.getElementById("table_acls" + "expression" + i); + row_v = d.getElementById("tr_view_" + i); row_e = d.getElementById("tr_edit_" + i); - row_v = d.getElementById("tr_viewdetail_" + i); + row_vd = d.getElementById("tr_viewdetail_" + i); if (!el || !row_e) continue; for (j = 0; j < count; j++) { @@ -543,10 +544,17 @@ $primaryfrontends = get_haproxy_frontends($excludefrontend); if (row_v) { Effect.Fade(row_v,{ duration: 1.0 }); } + if (row_vd) { + Effect.Fade(row_vd,{ duration: 1.0 }); + } } else { - Effect.Appear(row_e,{ duration: 1.0 }); - if (row_v) { - Effect.Appear(row_v,{ duration: 1.0 }); + if (!row_v || (row_v && row_v.style.display == "none")) { + // only make the edit row appear if the view row is not still on the screen. + // (when switching frontend types) + Effect.Appear(row_e,{ duration: 1.0 }); + } + if (row_vd) { + Effect.Appear(row_vd,{ duration: 1.0 }); } } } diff --git a/config/haproxy-devel/www/haproxy_pool_edit.php b/config/haproxy-devel/www/haproxy_pool_edit.php index 2b4787f3..54d9031f 100644 --- a/config/haproxy-devel/www/haproxy_pool_edit.php +++ b/config/haproxy-devel/www/haproxy_pool_edit.php @@ -491,7 +491,6 @@ foreach($simplefields as $field){ ?>