diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2015-11-01 02:30:39 +0100 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2015-11-01 02:30:39 +0100 |
commit | c79cec7933f3a3906ef8903ca5ddcf28be30d1f2 (patch) | |
tree | 768b5e277bbfa88bb546399d94238fc2a6489c90 /config/haproxy-devel/www | |
parent | e1fa969219ad8e25940fb020e32fbb5c4143a2e0 (diff) | |
download | pfsense-packages-c79cec7933f3a3906ef8903ca5ddcf28be30d1f2.tar.gz pfsense-packages-c79cec7933f3a3906ef8903ca5ddcf28be30d1f2.tar.bz2 pfsense-packages-c79cec7933f3a3906ef8903ca5ddcf28be30d1f2.zip |
haproxy-devel, user gui permissions, show backend usage, use-server action
Diffstat (limited to 'config/haproxy-devel/www')
-rw-r--r-- | config/haproxy-devel/www/haproxy_listeners.php | 60 | ||||
-rw-r--r-- | config/haproxy-devel/www/haproxy_listeners_edit.php | 4 |
2 files changed, 30 insertions, 34 deletions
diff --git a/config/haproxy-devel/www/haproxy_listeners.php b/config/haproxy-devel/www/haproxy_listeners.php index 5aef0a82..c7288e7d 100644 --- a/config/haproxy-devel/www/haproxy_listeners.php +++ b/config/haproxy-devel/www/haproxy_listeners.php @@ -93,6 +93,28 @@ if ($_GET['act'] == "del") { } } +function haproxy_userlist_backend_servers($backendname) { + //used for hint title text when hovering mouse over a backend name + global $a_servermodes; + $backend_servers = ""; + $backend = get_backend($backendname); + if ($backend && is_array($backend['ha_servers']) && is_array($backend['ha_servers']['item'])){ + $servers = $backend['ha_servers']['item']; + $backend_servers = sprintf(gettext("Servers in \"%s\" pool:"), $backendname); + if (is_array($servers)){ + foreach($servers as $server){ + $srvstatus = $server['status']; + $status = $a_servermodes[$srvstatus]['sign']; + if (isset($server['forwardto']) && $server['forwardto'] != "") + $backend_servers .= "\n{$status}[{$server['forwardto']}]"; + else + $backend_servers .= "\n{$status}{$server['address']}:{$server['port']}"; + } + } + } + return $backend_servers; +} + $pgtitle = "Services: HAProxy: Frontends"; include("head.inc"); haproxy_css(); @@ -238,24 +260,6 @@ function js_callback(req) { 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\" />"; - - $backend_serverpool_hint = ""; - $backend_serverpool = $frontend['backend_serverpool']; - $backend = get_backend($backend_serverpool); - if ($backend && is_array($backend['ha_servers']) && is_array($backend['ha_servers']['item'])){ - $servers = $backend['ha_servers']['item']; - $backend_serverpool_hint = gettext("Servers in pool:"); - if (is_array($servers)){ - foreach($servers as $server){ - $srvstatus = $server['status']; - $status = $a_servermodes[$srvstatus]['sign']; - if (isset($server['forwardto']) && $server['forwardto'] != "") - $backend_serverpool_hint .= "\n{$status}[{$server['forwardto']}]"; - else - $backend_serverpool_hint .= "\n{$status}{$server['address']}:{$server['port']}"; - } - } - } ?> </td> <td class="listr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';"> @@ -296,37 +300,29 @@ function js_callback(req) { ?> </td> <td class="listr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';"> - <div title='<?=$backend_serverpool_hint;?>'> <? - $first = true; if (is_array($frontend['a_actionitems']['item'])) { foreach ($frontend['a_actionitems']['item'] as $actionitem) { if ($actionitem['action'] == "use_backend") { - if ($first) { - $first = false; - } else { - echo "<br/>"; - } $backend = $actionitem['use_backendbackend']; + $hint = haproxy_userlist_backend_servers($backend); + echo "<div title='{$hint}'>"; echo "<a href='haproxy_pool_edit.php?id={$backend}'>{$backend}</a>"; - if (!empty($actionitem['acl'])) { echo " if({$actionitem['acl']})"; } + echo "<br/></div>"; } } } + $hint = haproxy_userlist_backend_servers($frontend['backend_serverpool']); $backend = $frontend['backend_serverpool']; if (!empty($backend)) { - if ($first) { - $first = false; - } else { - echo "<br/>"; - } + echo "<div title='{$hint}'>"; echo "<a href='haproxy_pool_edit.php?id={$backend}'>{$backend}</a> (default)"; + echo "<br/></div>"; } ?> - </div> </td> <td class="list" nowrap> <table border="0" cellspacing="0" cellpadding="1"> diff --git a/config/haproxy-devel/www/haproxy_listeners_edit.php b/config/haproxy-devel/www/haproxy_listeners_edit.php index 799cb3cd..9d2b0b05 100644 --- a/config/haproxy-devel/www/haproxy_listeners_edit.php +++ b/config/haproxy-devel/www/haproxy_listeners_edit.php @@ -253,11 +253,11 @@ $htmllist_extaddr->editmode = true; $htmllist_acls = new HaproxyHtmlList("table_acls", $fields_aclSelectionList); $htmllist_acls->fields_details = $fields_acl_details; -$htmllist_acls->editmode = true; +//$htmllist_acls->editmode = true; $htmllist_actions = new HaproxyHtmlList("table_actions", $fields_actions); $htmllist_actions->fields_details = $fields_actions_details; -$htmllist_actions->keyfield = "name"; +//$htmllist_actions->keyfield = "name"; //$htmllist_actions->editmode = true; $htmllist_sslCertificates = new HaproxyHtmlList("tbl_sslCerts", $fields_sslCertificates); |