From 51f497343aaff857e82115a27db9010435a43105 Mon Sep 17 00:00:00 2001 From: thompsa Date: Sun, 7 Feb 2010 23:41:35 +1300 Subject: Add server pools which encapsulate the backends. --- config/haproxy-dev/haproxy_pools.php | 92 ++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'config/haproxy-dev/haproxy_pools.php') diff --git a/config/haproxy-dev/haproxy_pools.php b/config/haproxy-dev/haproxy_pools.php index 4a0b08c9..5b9942b3 100755 --- a/config/haproxy-dev/haproxy_pools.php +++ b/config/haproxy-dev/haproxy_pools.php @@ -1,7 +1,7 @@ Copyright (C) 2008 Remco Hoef @@ -34,11 +34,11 @@ require_once("haproxy.inc"); $d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty"; -if (!is_array($config['installedpackages']['haproxy']['ha_servers']['item'])) { - $config['installedpackages']['haproxy']['ha_servers']['item'] = array(); +if (!is_array($config['installedpackages']['haproxy']['ha_pools']['item'])) { + $config['installedpackages']['haproxy']['ha_pools']['item'] = array(); } -$a_server = &$config['installedpackages']['haproxy']['ha_servers']['item']; +$a_pools = &$config['installedpackages']['haproxy']['ha_pools']['item']; $a_backends = &$config['installedpackages']['haproxy']['ha_backends']['item']; if ($_POST) { @@ -55,22 +55,20 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_server[$_GET['id']]) { - if (!$input_errors) { - unset($a_server[$_GET['id']]); - write_config(); - touch($d_haproxyconfdirty_path); - header("Location: haproxy_servers.php"); - exit; - } + if (isset($a_pools[$_GET['id']])) { + unset($a_pools[$_GET['id']]); + write_config(); + touch($d_haproxyconfdirty_path); } + header("Location: haproxy_pools.php"); + exit; } $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); if(strstr($pfSversion, "1.2")) $one_two = true; -$pgtitle = "Services: HAProxy: Servers"; +$pgtitle = "Services: HAProxy: Server pools"; include("head.inc"); ?> @@ -79,11 +77,11 @@ include("head.inc");

-
+

-You must apply the changes in order for them to take effect.");?>
+You must apply the changes in order for them to take effect.");?>
@@ -104,47 +102,49 @@ include("head.inc"); - - - + - + - - - - - - @@ -155,7 +155,7 @@ include("head.inc"); -- cgit v1.2.3
@@ -91,8 +89,8 @@ include("head.inc"); /* active tabs */ $tab_array = array(); $tab_array[] = array("Settings", false, "haproxy_global.php"); - $tab_array[] = array("Listener", false, "haproxy_frontends.php"); - $tab_array[] = array("Server Pool", true, "haproxy_servers.php"); + $tab_array[] = array("Listener", false, "haproxy_listeners.php"); + $tab_array[] = array("Server Pool", true, "haproxy_pools.php"); display_top_tabs($tab_array); ?>
Name Server StatusFrontendCookieWeightListener
- + + - + + - - - - - + + - + + - - + +
- +