aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy_listeners.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/haproxy-devel/haproxy_listeners.php')
-rw-r--r--config/haproxy-devel/haproxy_listeners.php72
1 files changed, 50 insertions, 22 deletions
diff --git a/config/haproxy-devel/haproxy_listeners.php b/config/haproxy-devel/haproxy_listeners.php
index 7b6e3d58..3ff53cea 100644
--- a/config/haproxy-devel/haproxy_listeners.php
+++ b/config/haproxy-devel/haproxy_listeners.php
@@ -1,8 +1,9 @@
<?php
/* $Id: load_balancer_virtual_server.php,v 1.6.2.1 2006/01/02 23:46:24 sullrich Exp $ */
/*
- haproxy_baclkends.php
+ haproxy_listeners.php
part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2013 PiBa-NL
Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
All rights reserved.
@@ -28,10 +29,11 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require_once("guiconfig.inc");
require_once("haproxy.inc");
require_once("certs.inc");
+require_once("haproxy_utils.inc");
if (!is_array($config['installedpackages']['haproxy']['ha_backends']['item'])) {
$config['installedpackages']['haproxy']['ha_backends']['item'] = array();
@@ -71,7 +73,7 @@ $pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
if(strstr($pfSversion, "1.2"))
$one_two = true;
-$pgtitle = "Services: HAProxy: Listener";
+$pgtitle = "Services: HAProxy: Frontends";
include("head.inc");
?>
@@ -83,17 +85,17 @@ include("head.inc");
<?php endif; ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_haproxyconfdirty_path)): ?><p>
-<?php print_info_box_np("The haproxy configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
+<?php if (file_exists($d_haproxyconfdirty_path)): ?>
+<?php print_info_box_np("The haproxy configuration has been changed.<br/>You must apply the changes in order for them to take effect.");?><br/>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
- /* active tabs */
- $tab_array = array();
+ /* active tabs */
+ $tab_array = array();
$tab_array[] = array("Settings", false, "haproxy_global.php");
- $tab_array[] = array("Listener", true, "haproxy_listeners.php");
- $tab_array[] = array("Server Pool", false, "haproxy_pools.php");
+ $tab_array[] = array("Frontend", true, "haproxy_listeners.php");
+ $tab_array[] = array("Backend", false, "haproxy_pools.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -108,7 +110,7 @@ include("head.inc");
<td width="30%" class="listhdrr">Description</td>
<td width="20%" class="listhdrr">Address</td>
<td width="5%" class="listhdrr">Type</td>
- <td width="10%" class="listhdrr">Server&nbsp;pool</td>
+ <td width="10%" class="listhdrr">Backend</td>
<td width="20%" class="listhdrr">Parent</td>
<td width="5%" class="list"></td>
</tr>
@@ -125,7 +127,7 @@ include("head.inc");
$a_frontend_grouped = array();
foreach($a_frontend as &$frontend2) {
- $ipport = get_frontend_ipport($frontend2);
+ $ipport = get_frontend_ipport($frontend2, true);
$frontend2['ipport'] = $ipport;
$a_frontend_grouped[$ipport][] = $frontend2;
}
@@ -138,7 +140,7 @@ include("head.inc");
foreach ($a_frontend_grouped as $a_frontend) {
usort($a_frontend,'sort_sharedfrontends');
if (count($a_frontend) > 1 || $last_frontend_shared) {
- ?> <tr class="<?=$textgray?>"><td collspan="7">&nbsp;</td></tr> <?
+ ?> <tr class="<?=$textgray?>"><td colspan="7">&nbsp;</td></tr> <?
}
$last_frontend_shared = count($a_frontend) > 1;
foreach ($a_frontend as $frontend) {
@@ -153,23 +155,47 @@ include("head.inc");
<?
if (strtolower($frontend['type']) == "http" && $frontend['ssloffload']) {
$cert = lookup_cert($frontend['ssloffloadcert']);
- echo '<img src="'.$img_cert.'" title="SSL offloading cert: '.$cert['descr'].'" alt="SSL offloading" border="0" height="16" width="16" />';
+ $descr = htmlspecialchars($cert['descr']);
+ $certs = $frontend['ha_certificates']['item'];
+ if (is_array($certs)){
+ if (count($certs) > 0){
+ foreach($certs as $certitem){
+ $cert = lookup_cert($certitem['ssl_certificate']);
+ $descr .= "\n".htmlspecialchars($cert['descr']);
+ }
+ }
+ }
+ echo '<img src="'.$img_cert.'" title="SSL offloading cert: '.$descr.'" alt="SSL offloading" border="0" height="16" width="16" />';
}
- $acls = get_frontent_acls($frontend);
+ $acls = get_frontend_acls($frontend);
$isaclset = "";
foreach ($acls as $acl) {
$isaclset .= "&#10;" . $acl['descr'];
}
+ if ($frontend['ssloffloadacl'])
+ $isaclset .= "&#10;" . "Certificate ACL";
+ if ($frontend['ssloffloadacladditional'])
+ $isaclset .= "&#10;" . "Additional certificate ACLs";
+
if ($isaclset)
- echo "<img src=\"$img_acl\" title=\"" . gettext("acl's used") . ": {$isaclset}\" border=\"0\">";
+ echo "<img src=\"$img_acl\" title=\"" . gettext("acl's used") . ": {$isaclset}\" border=\"0\" />";
$isadvset = "";
if ($frontend['advanced_bind']) $isadvset .= "Advanced bind: {$frontend['advanced_bind']}\r\n";
- if ($frontend['advanced']) $isadvset .= "advanced settings used\r\n";
+ if ($frontend['advanced']) $isadvset .= "Advanced pass thru setting used\r\n";
if ($isadvset)
- echo "<img src=\"$img_adv\" title=\"" . gettext("advanced settings set") . ": {$isadvset}\" border=\"0\">";
+ echo "<img src=\"$img_adv\" title=\"" . gettext("Advanced settings set") . ": {$isadvset}\" border=\"0\" />";
+ $backend_serverpool = $frontend['backend_serverpool'];
+ $backend = get_backend($backend_serverpool );
+ $servers = $backend['ha_servers']['item'];
+ $backend_serverpool_hint = gettext("Servers in pool:");
+ if (is_array($servers)){
+ foreach($servers as $server){
+ $backend_serverpool_hint .= "\n".$server['address'].":".$server['port'];
+ }
+ }
?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
@@ -179,13 +205,15 @@ include("head.inc");
<?=$frontend['desc'];?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
- <?=$frontend['ipport'];?>
+ <?=str_replace(" ","&nbsp;",$frontend['ipport']);?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
<?=$frontend['type']?>
</td>
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
+ <div title='<?=$backend_serverpool_hint;?>'>
<?=$frontend['backend_serverpool']?>
+ </div>
</td>
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
<?=$frontend['secondary'] == 'yes' ? $frontend['primary_frontend'] : "";?>
@@ -193,9 +221,9 @@ include("head.inc");
<td class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php?id=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_listeners.php?act=del&id=<?=$frontendname;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_listeners_edit.php?dup=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php?id=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit frontend");?>" width="17" height="17" border="0" /></a></td>
+ <td valign="middle"><a href="haproxy_listeners.php?act=del&amp;id=<?=$frontendname;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete frontend");?>" width="17" height="17" border="0" /></a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php?dup=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("clone frontend");?>" width="17" height="17" border="0" /></a></td>
</tr>
</table>
</td>
@@ -208,7 +236,7 @@ include("head.inc");
<td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new frontend");?>" width="17" height="17" border="0" /></a></td>
</tr>
</table>
</td>