Commit da8a2bed authored by Franco Fichtner's avatar Franco Fichtner

load balancer: remove unused relay pages and related backend parts

Dormant ever since 2009, time to remove those finally.
parent f2e68b90
...@@ -2547,20 +2547,25 @@ function upgrade_071_to_072() { ...@@ -2547,20 +2547,25 @@ function upgrade_071_to_072() {
rename_field($config['sysctl']['item'], 'desc', 'descr'); rename_field($config['sysctl']['item'], 'desc', 'descr');
} }
function upgrade_072_to_073() { function upgrade_072_to_073()
{
global $config; global $config;
if (!is_array($config['load_balancer']))
if (!isset($config['load_balancer'])) {
return; return;
if (is_array($config['load_balancer']['monitor_type'])) }
if (isset($config['load_balancer']['monitor_type'])) {
rename_field($config['load_balancer']['monitor_type'], 'desc', 'descr'); rename_field($config['load_balancer']['monitor_type'], 'desc', 'descr');
if (is_array($config['load_balancer']['lbpool'])) }
if (isset($config['load_balancer']['lbpool'])) {
rename_field($config['load_balancer']['lbpool'], 'desc', 'descr'); rename_field($config['load_balancer']['lbpool'], 'desc', 'descr');
if (is_array($config['load_balancer']['lbaction'])) }
rename_field($config['load_balancer']['lbaction'], 'desc', 'descr');
if (is_array($config['load_balancer']['lbprotocol'])) if (isset($config['load_balancer']['virtual_server'])) {
rename_field($config['load_balancer']['lbprotocol'], 'desc', 'descr');
if (is_array($config['load_balancer']['virtual_server']))
rename_field($config['load_balancer']['virtual_server'], 'desc', 'descr'); rename_field($config['load_balancer']['virtual_server'], 'desc', 'descr');
}
} }
function upgrade_073_to_074() { function upgrade_073_to_074() {
......
...@@ -139,11 +139,6 @@ function relayd_configure($kill_first=false) { ...@@ -139,11 +139,6 @@ function relayd_configure($kill_first=false) {
} else { } else {
$pool_a = null; $pool_a = null;
} }
if (isset($config['load_balancer']['lbprotocol'])) {
$protocol_a = $config['load_balancer']['lbprotocol'];
} else {
$protocol_a = null;
}
if (isset($config['load_balancer']['setting'])) { if (isset($config['load_balancer']['setting'])) {
$setting = $config['load_balancer']['setting']; $setting = $config['load_balancer']['setting'];
} else { } else {
......
...@@ -40,7 +40,7 @@ function listtags() ...@@ -40,7 +40,7 @@ function listtags()
'hash-algorithm-option', 'hosts', 'hash-algorithm-option', 'hosts',
'ifgroupentry', 'igmpentry', 'interface_array', 'item', 'ifgroupentry', 'igmpentry', 'interface_array', 'item',
'key', 'key',
'lagg', 'lbaction', 'lbpool', 'l7rules', 'lbprotocol', 'lagg', 'lbpool',
'member', 'menu', 'mobilekey', 'monitor_type', 'mount', 'member', 'menu', 'mobilekey', 'monitor_type', 'mount',
'npt', 'ntpserver', 'npt', 'ntpserver',
'onetoone', 'openvpn-server', 'openvpn-client', 'openvpn-csc', 'option', 'onetoone', 'openvpn-server', 'openvpn-client', 'openvpn-csc', 'option',
......
...@@ -803,34 +803,6 @@ ...@@ -803,34 +803,6 @@
"load_balancer_monitor.php*" "load_balancer_monitor.php*"
] ]
}, },
"page-services-loadbalancer-relay-action-edit": {
"name": "WebCfg - Services: Load Balancer: Relay Action: Edit page",
"descr": "Allow access to the 'Services: Load Balancer: Relay Action: Edit' page.",
"match": [
"load_balancer_relay_action_edit.php*"
]
},
"page-services-loadbalancer-relay-action": {
"name": "WebCfg - Services: Load Balancer: Relay Actions page",
"descr": "Allow access to the 'Services: Load Balancer: Relay Actions' page.",
"match": [
"load_balancer_relay_action.php*"
]
},
"page-services-loadbalancer-relay-protocol-edit": {
"name": "WebCfg - Services: Load Balancer: Relay Protocol: Edit page",
"descr": "Allow access to the 'Services: Load Balancer: Relay Protocol: Edit' page.",
"match": [
"load_balancer_relay_protocol_edit.php*"
]
},
"page-services-loadbalancer-relay-protocol": {
"name": "WebCfg - Services: Load Balancer: Relay Protocols page",
"descr": "Allow access to the 'Services: Load Balancer: Relay Protocols' page.",
"match": [
"load_balancer_relay_protocol.php*"
]
},
"page-services-loadbalancer-setting": { "page-services-loadbalancer-setting": {
"name": "WebCfg - Services: Load Balancer: setting page", "name": "WebCfg - Services: Load Balancer: setting page",
"descr": "Allow access to the 'Settings: Load Balancer: Settings' page.", "descr": "Allow access to the 'Settings: Load Balancer: Settings' page.",
......
/*
Copyright (C) 2005-2008 Bill Marquette <bill.marquette@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This code makes use of prototype shortcuts and will not work
* without prototype being loaded prior to it.
*/
function copyOption(theSrc, theDst)
{
var selOption = theSrc[theSrc.selectedIndex];
theDst.options[theDst.length] = new Option(selOption.text, selOption.value);
}
function deleteOption(theSel)
{
var theIndex = theSel.selectedIndex;
var selLength = theSel.length;
if(selLength>0)
{
theSel.options[theIndex] = null;
}
}
function AllOptions(el, selectAll) {
el.select('option').each(function(opt) {
opt.selected = selectAll;
});
}
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("filter.inc");
require_once("load_balancer_maintable.inc");
require_once("services.inc");
require_once("vslb.inc");
if (!is_array($config['load_balancer']['lbaction'])) {
$config['load_balancer']['lbaction'] = array();
}
$a_action = &$config['load_balancer']['lbaction'];
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
$retval = 0;
$retval |= filter_configure();
$retval |= relayd_configure();
$savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer');
}
}
if ($_GET['act'] == "del") {
if (array_key_exists($_GET['id'], $a_action)) {
/* make sure no relay protocols reference this entry */
if (is_array($config['load_balancer']['lbprotocol'])) {
foreach ($config['load_balancer']['lbprotocol'] as $lbp) {
foreach($lbp['lbaction'] as $lba) {
if ($lba['name'] == $a_action[$_GET['id']]['name']) {
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one relay protocol.");
break;
}
}
}
}
if (!$input_errors) {
unset($a_action[$_GET['id']]);
write_config();
mark_subsystem_dirty('loadbalancer');
header("Location: load_balancer_relay_action.php");
exit;
}
}
}
/* Index lbpool array for easy hyperlinking */
/* for ($i = 0; isset($config['load_balancer']['lbprotocol'][$i]); $i++) {
for ($o = 0; isset($config['load_balancer']['lbprotocol'][$i]['options'][$o]); o++) {
$a_vs[$i]['options'][$o] = "
$a_vs[$i]['poolname'] = "<a href=\"/load_balancer_pool_edit.php?id={$poodex[$a_vs[$i]['poolname']]}\">{$a_vs[$i]['poolname']}</a>";
if ($a_vs[$i]['sitedown'] != '') {
$a_vs[$i]['sitedown'] = "<a href=\"/load_balancer_pool_edit.php?id={$poodex[$a_vs[$i]['sitedown']]}\">{$a_vs[$i]['sitedown']}</a>";
} else {
$a_vs[$i]['sitedown'] = 'none';
}
}
*/
$shortcut_section = "relayd";
include("head.inc");
?>
<body>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_apply(gettext("The load balancer configuration has been changed.<br />You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?>
<section class="col-xs-12">
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Pools"), false, "load_balancer_pool.php");
$tab_array[] = array(gettext("Virtual Servers"), false, "load_balancer_virtual_server.php");
$tab_array[] = array(gettext("Relay Actions"), true, "load_balancer_relay_action.php");
$tab_array[] = array(gettext("Relay Protocols"), false, "load_balancer_relay_protocol.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<div class="container-fluid">
<form action="load_balancer_relay_action.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<?
$t = new MainTable();
$t->edit_uri('load_balancer_relay_action_edit.php');
$t->my_uri('load_balancer_relay_action.php');
$t->add_column(gettext('Name'),'name',20);
$t->add_column(gettext('Type'),'type',10);
$t->add_column(gettext('Options'),'options',30);
$t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
$t->add_content_array($a_action);
$t->display();
?>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
This diff is collapsed.
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("filter.inc");
require_once("load_balancer_maintable.inc");
require_once("services.inc");
require_once("vslb.inc");
if (!is_array($config['load_balancer']['lbprotocol'])) {
$config['load_balancer']['lbprotocol'] = array();
}
$a_protocol = &$config['load_balancer']['lbprotocol'];
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
$retval = 0;
$retval |= filter_configure();
$retval |= relayd_configure();
$savemsg = get_std_save_message();
clear_subsystem_dirty('loadbalancer');
}
}
if ($_GET['act'] == "del") {
if (array_key_exists($_GET['id'], $a_protocol)) {
/* make sure no virtual servers reference this entry */
if (is_array($config['load_balancer']['virtual_server'])) {
foreach ($config['load_balancer']['virtual_server'] as $vs) {
if ($vs['protocol'] == $a_protocol[$_GET['id']]['name']) {
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one virtual server.");
break;
}
}
}
if (!$input_errors) {
unset($a_protocol[$_GET['id']]);
write_config();
mark_subsystem_dirty('loadbalancer');
header("Location: load_balancer_relay_protocol.php");
exit;
}
}
}
/* Index lbpool array for easy hyperlinking */
/* for ($i = 0; isset($config['load_balancer']['lbprotocol'][$i]); $i++) {
for ($o = 0; isset($config['load_balancer']['lbprotocol'][$i]['options'][$o]); o++) {
$a_vs[$i]['options'][$o] = "
$a_vs[$i]['poolname'] = "<a href=\"/load_balancer_pool_edit.php?id={$poodex[$a_vs[$i]['poolname']]}\">{$a_vs[$i]['poolname']}</a>";
if ($a_vs[$i]['sitedown'] != '') {
$a_vs[$i]['sitedown'] = "<a href=\"/load_balancer_pool_edit.php?id={$poodex[$a_vs[$i]['sitedown']]}\">{$a_vs[$i]['sitedown']}</a>";
} else {
$a_vs[$i]['sitedown'] = 'none';
}
}
*/
$shortcut_section = "relayd";
include("head.inc");
?>
<body>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_apply(gettext("The load balancer configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?>
<section class="col-xs-12">
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Pools"), false, "load_balancer_pool.php");
$tab_array[] = array(gettext("Virtual Servers"), false, "load_balancer_virtual_server.php");
$tab_array[] = array(gettext("Relay Actions"), false, "load_balancer_relay_action.php");
$tab_array[] = array(gettext("Relay Protocols"), true, "load_balancer_relay_protocol.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<div class="container-fluid">
<form action="load_balancer_relay_protocol.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<?
$t = new MainTable();
$t->edit_uri('load_balancer_relay_protocol_edit.php');
$t->my_uri('load_balancer_relay_protocol.php');
$t->add_column(gettext('Name'),'name',20);
$t->add_column(gettext('Type'),'type',10);
$t->add_column(gettext('Options'),'options',30);
$t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
$t->add_content_array($a_protocol);
$t->display();
?>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("services.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_relay_protocol.php');
if (!is_array($config['load_balancer']['lbprotocol'])) {
$config['load_balancer']['lbprotocol'] = array();
}
$a_protocol = &$config['load_balancer']['lbprotocol'];
if (is_numericint($_GET['id']))
$id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id']))
$id = $_POST['id'];
if (isset($id) && $a_protocol[$id]) {
$pconfig = $a_protocol[$id];
$pconfig['type'] = $a_protocol[$id]['type'];
$pconfig['descr'] = $a_protocol[$id]['descr'];
$pconfig['lbaction'] = array();
$pconfig['options'] = $a_protocol[$id]['options'];
} else {
/* Some sane page defaults */
$pconfig['type'] = 'http';
}
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
$reqdfields = explode(" ", "name type descr");
$reqdfieldsn = array(gettext("Name"),gettext("Type"),gettext("Description"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
/* Ensure that our monitor names are unique */
for ($i=0; isset($config['load_balancer']['lbprotocol'][$i]); $i++)
if (($_POST['name'] == $config['load_balancer']['lbprotocol'][$i]['name']) && ($i != $id))
$input_errors[] = gettext("This protocol name has already been used. Protocol names must be unique.");
if (strpos($_POST['name'], " ") !== false)
$input_errors[] = gettext("You cannot use spaces in the 'name' field.");
switch($_POST['type']) {
case 'tcp':
case 'http':
case 'https':
case 'dns': {
break;
}
}
if (!$input_errors) {
$protent = array();
if(isset($id) && $a_protocol[$id]) {
$protent = $a_protocol[$id];
}
update_if_changed(gettext("name"), $protent['name'], $pconfig['name']);
update_if_changed(gettext("type"), $protent['type'], $pconfig['type']);
update_if_changed(gettext("description"), $protent['descr'], $pconfig['descr']);
update_if_changed(gettext("type"), $protent['type'], $pconfig['type']);
update_if_changed(gettext("action"), $protent['lbaction'], $pconfig['lbaction']);
if (isset($id) && $a_protocol[$id]) {
/* modify all virtual servers with this name */
/*
for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) {
if ($config['load_balancer']['virtual_server'][$i]['protocol'] == $a_protocol[$id]['name'])
$config['load_balancer']['virtual_server'][$i]['protocol'] = $protent['name'];
}
*/
$a_protocol[$id] = $protent;
} else {
$a_protocol[] = $protent;
}
mark_subsystem_dirty('loadbalancer');
write_config();
header("Location: load_balancer_relay_protocol.php");
exit;
}
}
$shortcut_section = "relayd";
include("head.inc");
$types = array("http" => gettext("HTTP"), "tcp" => gettext("TCP"), "dns" => gettext("DNS"));
?>
<body>
<script type="text/javascript">
function updateType(t){
switch(t) {
<?php
/* OK, so this is sick using php to generate javascript, but it needed to be done */
foreach ($types as $key => $val) {
echo " case \"{$key}\": {\n";
$t = $types;
foreach ($t as $k => $v) {
if ($k != $key) {
echo " jQuery('#{$k}').hide();\n";
}
}
echo " }\n";
}
?>
}
jQuery('#' + t).show();
}
function num_options() {
return jQuery('#options_table').children().length - 1;
}
/*
jQuery(document).ready(function(){
$$('.action').each(function(action) {
new Draggable(action, {revert: true, ghosting: true});
});
Droppables.add('actions', {
accept: 'action', onDrop: function(action) {
var new_action = new Element('li');
new Draggable(new_action, {revert: true});
$('action_list').appendChild(new_action);
}
});
});
*/
</script>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<form action="load_balancer_relay_protocol_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Load Balancer - Relay Protocol entry"); ?></td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input name="name" type="text" <?php if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16">
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Type"); ?></td>
<td width="78%" class="vtable" colspan="2">
<select id="type" name="type">
<?
foreach ($types as $key => $val) {
if(isset($pconfig['type']) && $pconfig['type'] == $key) {
$selected = " selected";
} else {
$selected = "";
}
echo "<option value=\"{$key}\" onclick=\"updateType('{$key}');\"{$selected}>{$val}</option>\n";
}
?>
</select>
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input name="descr" type="text" <?php if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Add / remove available actions"); ?></td>
</tr>
<tr align="left" id="actions">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Actions"); ?></td>
<td width="78%" class="vtable" colspan="2">
<table>
<tbody>
<tr>
<td>
<center>
<b><?=gettext("Available Actions"); ?></b>
<br />
<select id="available_action" name="available_action[]" multiple="true" size="5">
<?php
if (is_array($config['load_balancer']['lbaction'])) {
foreach($config['load_balancer']['lbaction'] as $actent) {
if($actent != '') echo " <option value=\"{$actent['name']}\">{$actent['name']}</option>\n";
}
}
echo "</select>";
?>
<br />
</td>
<td valign="middle">
<center>
<input class="formbtn" type="button" name="copyToEnabled" value="<?=gettext("Add"); ?>" onclick="copyOption($('available_action'), $('lbaction'));" /><br />
<input class="formbtn" type="button" name="removeFromEnabled" value="<?=gettext("Remove"); ?>" onclick="deleteOption($('lbaction'));" />
</center>
</td>
<td>
<center>
<b><?=gettext("Enabled Actions"); ?></b>
<br />
<select id="lbaction" name="lbaction[]" multiple="true" size="5">
<?php
if (is_array($pconfig['lbaction'])) {
foreach($pconfig['lbaction'] as $actent) {
echo " <option value=\"{$actent}\">{$actent}</option>\n";
}
}
echo "</select>";
?>
<br />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr align="left">
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onClick="AllOptions($('lbaction'), true); AllOptions($('available_action'), false);">
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_protocol[$id] && $_GET['act'] != 'dup'): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
<?php endif; ?>
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment