aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <andy@fud.org.nz>2010-03-12 17:43:00 +1300
committerthompsa <andy@fud.org.nz>2010-03-12 17:43:00 +1300
commite455a5327161728e87d8b214c0b31d9007d5e90a (patch)
treec56adb074409cf917d0822c6c8ae437ec02e78ac
parent155c3634e0e4e6a4fc7b3488bdf032a1661e8779 (diff)
downloadpfsense-packages-e455a5327161728e87d8b214c0b31d9007d5e90a.tar.gz
pfsense-packages-e455a5327161728e87d8b214c0b31d9007d5e90a.tar.bz2
pfsense-packages-e455a5327161728e87d8b214c0b31d9007d5e90a.zip
Remove the 'status' from the backend pool and just show it disabled if
no listeners are using it.
-rw-r--r--config/haproxy-dev/haproxy.inc2
-rwxr-xr-xconfig/haproxy-dev/haproxy_pool_edit.php11
-rwxr-xr-xconfig/haproxy-dev/haproxy_pools.php33
3 files changed, 19 insertions, 27 deletions
diff --git a/config/haproxy-dev/haproxy.inc b/config/haproxy-dev/haproxy.inc
index 97a20faa..ed8da06d 100644
--- a/config/haproxy-dev/haproxy.inc
+++ b/config/haproxy-dev/haproxy.inc
@@ -245,7 +245,7 @@ function haproxy_find_acl($name) {
}
function write_backend($fd, $name, $pool, $frontend) {
- if($pool['status'] != 'active' || !is_array($pool['ha_servers']['item']))
+ if(!is_array($pool['ha_servers']['item']))
continue;
fwrite ($fd, "backend " . $name . "\n");
diff --git a/config/haproxy-dev/haproxy_pool_edit.php b/config/haproxy-dev/haproxy_pool_edit.php
index 6087e9d7..d25f0675 100755
--- a/config/haproxy-dev/haproxy_pool_edit.php
+++ b/config/haproxy-dev/haproxy_pool_edit.php
@@ -52,7 +52,6 @@ if (isset($id) && $a_pools[$id]) {
$pconfig['checkinter'] = $a_pools[$id]['checkinter'];
$pconfig['monitor_uri'] = $a_pools[$id]['monitor_uri'];
$pconfig['cookie'] = $a_pools[$id]['cookie'];
- $pconfig['status'] = $a_pools[$id]['status'];
$pconfig['advanced'] = base64_decode($a_pools[$id]['advanced']);
$pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item'];
}
@@ -145,7 +144,6 @@ if ($_POST) {
$pool['ha_servers']['item']=$a_servers;
update_if_changed("name", $pool['name'], $_POST['name']);
- update_if_changed("status", $pool['status'], $_POST['status']);
update_if_changed("cookie", $pool['cookie'], $_POST['cookie']);
update_if_changed("advanced", $pool['advanced'], base64_encode($_POST['advanced']));
update_if_changed("checkinter", $pool['checkinter'], $_POST['checkinter']);
@@ -231,15 +229,6 @@ function clearcombo(){
</td>
</tr>
<tr align="left">
- <td width="22%" valign="top" class="vncellreq">Status</td>
- <td width="78%" class="vtable" colspan="2">
- <select name="status">
- <option value="active" <?php if($pconfig['status']=='active') echo "SELECTED";?>>active</option>
- <option value="inactive" <?php if($pconfig['status']=='inactive') echo "SELECTED";?>>inactive</option>
- </select>
- </td>
- </tr>
- <tr align="left">
<td width="22%" valign="top" class="vncell">Cookie</td>
<td width="78%" class="vtable" colspan="2">
<input name="cookie" type="text" <?if(isset($pconfig['cookie'])) echo "value=\"{$pconfig['cookie']}\"";?>size="64"><br/>
diff --git a/config/haproxy-dev/haproxy_pools.php b/config/haproxy-dev/haproxy_pools.php
index 78a1fdff..c5adc70b 100755
--- a/config/haproxy-dev/haproxy_pools.php
+++ b/config/haproxy-dev/haproxy_pools.php
@@ -103,38 +103,41 @@ include("head.inc");
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" class="listhdrr">Name</td>
- <td width="20%" class="listhdrr">Status</td>
- <td width="30%" class="listhdrr">Listener</td>
+ <td width="10%" class="listhdrr">Servers</td>
+ <td width="40%" class="listhdrr">Listener</td>
<td width="10%" class="list"></td>
</tr>
<?php
$i = 0;
foreach ($a_pools as $pool):
+
+ $fe_list = "";
+ $sep = "";
+ foreach ($a_backends as $backend) {
+ if($backend['pool'] == $pool['name']) {
+ $fe_list .= $sep . $backend['name'];
+ $sep = ", ";
+ }
+ }
$textss = $textse = "";
- if ($pool['status'] != 'active') {
+ if ($fe_list == "") {
$textss = "<span class=\"gray\">";
$textse = "</span>";
}
+ if (is_array($pool['ha_servers']['item']))
+ $count = count($pool['ha_servers']['item']);
+ else
+ $count = 0;
?>
<tr>
<td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
<?=$textss . $pool['name'] . $textse;?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
- <?=$textss . $pool['status'] . $textse;?>
+ <?=$textss . $count . $textse;?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
-<?php
- echo $textss;
- $sep = "";
- foreach ($a_backends as $backend) {
- if($backend['pool'] == $pool['name']) {
- echo $sep . $backend['name'];
- $sep = ", ";
- }
- }
- echo $textse;
-?>
+ <?=$textss . $fe_list . $textse;?>
</td>
<td class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1">