From b6f71f6437833f631fd695fcee37b150f453b9d1 Mon Sep 17 00:00:00 2001 From: Torben Nielsen Date: Mon, 4 Mar 2013 20:15:19 +0100 Subject: adjust layout --- config/haproxy-devel/haproxy_pool_edit.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index 6720122b..5724e6e3 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -366,10 +366,10 @@ row_helper(); Balance - + - - - - + + + + + + + +
+ >Round robin @@ -381,7 +381,7 @@ row_helper();
+ >Static Round Robin @@ -396,7 +396,7 @@ row_helper();
+ >Least Connections -- cgit v1.2.3 From 0e21a5f32bbc00e783881ef748a15c424743e618 Mon Sep 17 00:00:00 2001 From: Torben Nielsen Date: Mon, 4 Mar 2013 20:58:06 +0100 Subject: isnumeric(weight) is enough to check valid server weight --- config/haproxy-devel/haproxy_pool_edit.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'config') diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index 5724e6e3..b8cb5db6 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -136,11 +136,10 @@ if ($_POST) { if (!preg_match("/.{2,}/", $server_address)) $input_errors[] = "The field 'Address' is required."; - if (!preg_match("/.{2,}/", $server_weight)) - $input_errors[] = "The field 'Weight' is required."; if (!is_numeric($server_weight)) $input_errors[] = "The field 'Weight' value is not a number."; + if ($server_port && !is_numeric($server_port)) $input_errors[] = "The field 'Port' value is not a number."; } -- cgit v1.2.3 From 179db50fb0ed2db1836fb019e673f6632d46a668 Mon Sep 17 00:00:00 2001 From: Torben Nielsen Date: Mon, 4 Mar 2013 21:38:21 +0100 Subject: add option for setting per backend advanced settings (current only takes pr server) --- config/haproxy-devel/haproxy.inc | 10 ++++++++++ config/haproxy-devel/haproxy_pool_edit.php | 19 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 05264c87..559788c7 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -377,6 +377,16 @@ function write_backend($fd, $name, $pool, $frontend) { $uri = "/"; fwrite ($fd, "\toption\t\t\t{$httpchk} HEAD " . $uri . " HTTP/1.0\n"); + if ($pool['advanced_backend']) { + $adv_be = explode("\n", base64_decode($pool['advanced_backend'])); + foreach($adv_be as $adv_line) { + $adv_line = trim($adv_line); + if ($adv_line != "") { + fwrite($fd, "\t" . $adv_line . "\n"); + } + } + } + if($pool['cookie'] && strtolower($frontend['type']) == "http") $cookie = " cookie {$pool['cookie']} "; else diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index b8cb5db6..78cdc7c9 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -56,6 +56,7 @@ if (isset($id) && $a_pools[$id]) { $pconfig['monitor_uri'] = $a_pools[$id]['monitor_uri']; $pconfig['cookie'] = $a_pools[$id]['cookie']; $pconfig['advanced'] = base64_decode($a_pools[$id]['advanced']); + $pconfig['advanced_backend'] = base64_decode($a_pools[$id]['advanced_backend']); $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; foreach($simplefields as $stat) @@ -171,6 +172,7 @@ if ($_POST) { update_if_changed("name", $pool['name'], $_POST['name']); update_if_changed("cookie", $pool['cookie'], $_POST['cookie']); update_if_changed("advanced", $pool['advanced'], base64_encode($_POST['advanced'])); + update_if_changed("advanced_backend", $pool['advanced_backend'], base64_encode($_POST['advanced_backend'])); update_if_changed("checkinter", $pool['checkinter'], $_POST['checkinter']); update_if_changed("monitor_uri", $pool['monitor_uri'], $_POST['monitor_uri']); @@ -443,13 +445,24 @@ row_helper();
Advanced pass thruPer server pass thru - + ' size="64">
- NOTE: paste text into this box that you would like to pass thru. + NOTE: paste text into this box that you would like to pass thru. Applied to each 'server' line.
Backend pass thru + +
+ NOTE: paste text into this box that you would like to pass thru. Applied to the backend section. +

-- cgit v1.2.3 From b07c1bde3a5179b90b2e4aecdf6d2a0d08bb159e Mon Sep 17 00:00:00 2001 From: Torben Nielsen Date: Mon, 4 Mar 2013 22:02:54 +0100 Subject: add option fore removing a server row --- config/haproxy-devel/haproxy_pool_edit.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config') diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index 78cdc7c9..fa46efb2 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -330,6 +330,9 @@ row_helper(); +
+ +
@@ -681,6 +684,14 @@ function dupRow(rowId, tableId) { } } +function deleteRow(rowId, tableId) { + var view = document.getElementById("tr_view_" + rowId); + var edit = document.getElementById("tr_edit_" + rowId); + + view.parentNode.removeChild(view); + edit.parentNode.removeChild(edit); +} + function removeRow(el) { var cel; // Break out of one table first -- cgit v1.2.3