diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-04-15 11:00:00 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-04-15 11:01:27 -0400 |
commit | e8dcc1dd4aa6abd558ec549e1872f5705d048689 (patch) | |
tree | 9f7e6f72595723620e6cc3e10616e06f6665dfe0 | |
parent | 994895f3a7169c308f42d11098f505e6c2d6f143 (diff) | |
download | pfsense-e8dcc1dd4aa6abd558ec549e1872f5705d048689.zip pfsense-e8dcc1dd4aa6abd558ec549e1872f5705d048689.tar.gz |
Fixed #6169
and added alias pop-ups to load_balancer_virtual_server.php
(cherry picked from commit 0200db178ef225f796aea837e33ae438f5899ae3)
-rw-r--r-- | src/usr/local/www/load_balancer_virtual_server.php | 35 | ||||
-rw-r--r-- | src/usr/local/www/load_balancer_virtual_server_edit.php | 4 |
2 files changed, 36 insertions, 3 deletions
diff --git a/src/usr/local/www/load_balancer_virtual_server.php b/src/usr/local/www/load_balancer_virtual_server.php index c2296b4..b85d189 100644 --- a/src/usr/local/www/load_balancer_virtual_server.php +++ b/src/usr/local/www/load_balancer_virtual_server.php @@ -118,6 +118,26 @@ for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) { } } +// Return the index of any alias matching the specified name and type +function alias_idx($name, $type) { + global $config; + + if (empty($config['aliases']['alias'])) { + return(-1); + } + + $idx = 0; + foreach ($config['aliases']['alias'] as $alias) { + if (($alias['name'] == $name) && ($alias['type'] == $type)) { + return($idx); + } + + $idx++; + } + + return(-1); +} + $pgtitle = array(gettext("Services"), gettext("Load Balancer"), gettext("Virtual Servers")); $shortcut_section = "relayd-virtualservers"; @@ -166,11 +186,24 @@ display_top_tabs($tab_array); if (!empty($a_vs)) { $i = 0; foreach ($a_vs as $a_v) { + ?> <tr> <td><?=htmlspecialchars($a_v['name'])?></td> <td><?=htmlspecialchars($a_v['relay_protocol'])?></td> - <td><?=htmlspecialchars($a_v['ipaddr'])?></td> +<?php + + $aidx = alias_idx($a_v['ipaddr'], "host"); + + if ($aidx >= 0) { + print("<td>\n"); + print('<a href="/firewall_aliases_edit.php?id=' . $aidx . '" data-toggle="popover" data-trigger="hover focus" title="Alias details" data-content="' . alias_info_popup($aidx) . '" data-html="true">'); + print(htmlspecialchars($a_v['ipaddr']) . '</a></td>'); + } else { + print('<td>' . htmlspecialchars($a_v['ipaddr']) . '</td>'); + } + +?> <td><?=htmlspecialchars($a_v['port'])?></td> <td><?=$a_v['poolname']?></td> <td><?=$a_v['sitedown']?></td> diff --git a/src/usr/local/www/load_balancer_virtual_server_edit.php b/src/usr/local/www/load_balancer_virtual_server_edit.php index 38373ad..9e49154 100644 --- a/src/usr/local/www/load_balancer_virtual_server_edit.php +++ b/src/usr/local/www/load_balancer_virtual_server_edit.php @@ -219,10 +219,10 @@ $section->addInput(new Form_Input( $pconfig['descr'] )); - -$section->addInput(new Form_IpAddress( +$section->addInput(new Form_Input( 'ipaddr', 'IP Address', + 'text', $pconfig['ipaddr'] ))->setHelp('This is normally the WAN IP address for the server to listen on. ' . 'All connections to this IP and port will be forwarded to the pool cluster. ' . |