Commit 99d02e9a authored by Franco Fichtner's avatar Franco Fichtner

load_balancer: apply whitespace cleanups

parent 78935e17
......@@ -100,18 +100,18 @@ $main_buttons = array(
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_np(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
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Pools"), false, "load_balancer_pool.php");
......@@ -119,12 +119,12 @@ $main_buttons = array(
$tab_array[] = array(gettext("Monitors"), true, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Settings"), false, "load_balancer_setting.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_monitor.php" method="post" name="iform" id="iform">
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_monitor.php" method="post" name="iform" id="iform">
<div class="table-responsive">
......@@ -142,12 +142,12 @@ $main_buttons = array(
$t->display();
?>
</div>
</form>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -145,7 +145,7 @@ if ($_POST) {
$monent = $a_monitor[$id];
if($monent['name'] != "")
$changedesc .= " " . sprintf(gettext("modified '%s' monitor:"), $monent['name']);
update_if_changed("name", $monent['name'], $pconfig['name']);
update_if_changed("type", $monent['type'], $pconfig['type']);
update_if_changed("description", $monent['descr'], $pconfig['descr']);
......@@ -180,7 +180,7 @@ if ($_POST) {
$a_monitor[$id] = $monent;
} else
$a_monitor[] = $monent;
if ($changecount > 0) {
/* Mark config dirty */
mark_subsystem_dirty('loadbalancer');
......@@ -203,7 +203,7 @@ $types = array("icmp" => gettext("ICMP"), "tcp" => gettext("TCP"), "http" => get
<body>
<?php include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
function updateType(t){
......@@ -230,20 +230,20 @@ $types = array("icmp" => gettext("ICMP"), "tcp" => gettext("TCP"), "http" => get
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<form action="load_balancer_monitor_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<div class="content-box">
<form action="load_balancer_monitor_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 - Monitor entry"); ?></td>
</tr>
<tr align="left">
......@@ -335,7 +335,7 @@ $types = array("icmp" => gettext("ICMP"), "tcp" => gettext("TCP"), "http" => get
</td>
</tr>
<!-- BILLM: XXX not supported digest checking just yet
<tr align="left">
<td width="22%" valign="top" class="vncellreq">MD5 Page Digest</td>
<td width="78%" class="vtable" colspan="2">
......@@ -376,12 +376,12 @@ $types = array("icmp" => gettext("ICMP"), "tcp" => gettext("TCP"), "http" => get
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -110,19 +110,19 @@ $main_buttons = array(
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_np(sprintf(gettext("The load balancer configuration has been changed%sYou must apply the changes in order for them to take effect."), "<br />"));?><br />
<?php endif; ?>
<section class="col-xs-12">
<?php
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Pools"), true, "load_balancer_pool.php");
......@@ -130,15 +130,15 @@ $main_buttons = array(
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Settings"), false, "load_balancer_setting.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_pool.php" method="post" name="iform" id="iform">
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_pool.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<?php
$t = new MainTable();
$t->edit_uri('load_balancer_pool_edit.php');
......@@ -161,12 +161,12 @@ $main_buttons = array(
<?= sprintf(gettext("The Load Balancer in %s is for server load balancing, not Multi-WAN. For load balancing or failover for multiple WANs, use "), $g['product_name']);?>
<a href="/system_gateway_groups.php"><?= gettext("Gateway Groups"); ?></a>
</div>
</form>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -135,7 +135,7 @@ if ($_POST) {
$poolent = $a_pool[$id];
if($poolent['name'] != "")
$changedesc .= sprintf(gettext(" modified '%s' pool:"), $poolent['name']);
update_if_changed("name", $poolent['name'], $_POST['name']);
update_if_changed("mode", $poolent['mode'], $_POST['mode']);
update_if_changed("description", $poolent['descr'], $_POST['descr']);
......@@ -154,7 +154,7 @@ if ($_POST) {
$a_pool[$id] = $poolent;
} else
$a_pool[] = $poolent;
if ($changecount > 0) {
/* Mark pool dirty */
mark_subsystem_dirty('loadbalancer');
......@@ -186,26 +186,26 @@ include("head.inc");
}
//]]>
</script>
<script type="text/javascript" src="/javascript/autosuggest.js"></script>
<script type="text/javascript" src="/javascript/suggestions.js"></script>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<form action="load_balancer_pool_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<div class="content-box">
<form action="load_balancer_pool_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("Add/edit Load Balancer - Pool entry"); ?></td>
</tr>
......@@ -230,7 +230,7 @@ include("head.inc");
<input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?> size="64" />
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" id="monitorport_text" class="vncellreq"><?=gettext("Port"); ?></td>
<td width="78%" class="vtable" colspan="2">
......@@ -284,7 +284,7 @@ include("head.inc");
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server IP Address"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input name="ipaddr" type="text" size="16" style="float: left;" />
<input name="ipaddr" type="text" size="16" style="float: left;" />
<input class="btn btn-default" type="button" name="button1" value="<?=gettext("Add to pool"); ?>" onclick="AddServerToPool(document.iform); enforceFailover(); checkPoolControls();" /><br />
</td>
</tr>
......@@ -314,12 +314,12 @@ include("head.inc");
</select>
<input class="btn btn-default" type="button" name="removeDisabled" value="<?=gettext("Remove"); ?>" onclick="RemoveServerFromPool(document.iform, 'serversdisabled[]');" />
</td>
<td valign="middle" align="center">
<button class="btn btn-default btn-xs" id="moveToEnabled" name="moveToEnabled" onclick="moveOptions(document.iform.serversDisabledSelect, document.iform.serversSelect); checkPoolControls();"><span class="glyphicon glyphicon-arrow-left"></span></button><br />
<button class="btn btn-default btn-xs" id="moveToDisabled" name="moveToDisabled" onclick="moveOptions(document.iform.serversSelect, document.iform.serversDisabledSelect); checkPoolControls();"><span class="glyphicon glyphicon-arrow-right"></span></button>
</td>
<td align="center">
<b><?=gettext("Enabled (default)"); ?></b>
<br/>
......@@ -343,7 +343,7 @@ include("head.inc");
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<br />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" onclick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" onclick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_pool[$id] && $_GET['act'] != 'dup'): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
......@@ -351,12 +351,12 @@ include("head.inc");
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -92,7 +92,7 @@ if ($_GET['act'] == "del") {
/* 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]['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>";
......@@ -114,19 +114,19 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np(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
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
......@@ -136,11 +136,11 @@ include("head.inc");
$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="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">
<?
......@@ -158,13 +158,13 @@ include("head.inc");
$t->display();
?>
</div>
</form>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -61,7 +61,7 @@ if (isset($id) && $a_action[$id]) {
/* Some sane page defaults */
$pconfig['protocol'] = 'http';
$pconfig['direction'] = 'request';
$pconfig['type'] = 'cookie';
$pconfig['type'] = 'cookie';
$pconfig['action'] = 'change';
}
......@@ -135,7 +135,7 @@ if ($_POST) {
$actent = $a_action[$id];
if($actent['name'] != "")
$changedesc .= " " . sprintf(gettext("modified '%s' action:"), $actent['name']);
update_if_changed("name", $actent['name'], $pconfig['name']);
update_if_changed("protocol", $actent['protocol'], $pconfig['protocol']);
update_if_changed("type", $actent['type'], $pconfig['type']);
......@@ -149,7 +149,7 @@ if ($_POST) {
case "filter": {
update_if_changed("value", $actent['options']['value'], $pconfig['option_action_value']);
update_if_changed("key", $actent['options']['akey'], $pconfig['option_action_key']);
break;
break;
}
case "hash":
case "log": {
......@@ -157,7 +157,7 @@ if ($_POST) {
break;
}
}
if (isset($id) && $a_action[$id]) {
// XXX - TODO
/* modify all virtual servers with this name */
......@@ -238,7 +238,7 @@ function updateProtocol(m) {
foreach ($actions['direction'][$ddir][$type] as $action => $av ) {
if($dtype == $type) {
echo "jQuery('#{$ddir}_{$type}_{$action}').show();";
}
}
}
}
?>
......@@ -392,10 +392,10 @@ function num_options() {
jQuery(document).ready(function() {
updateProtocol('<?=htmlspecialchars($pconfig['protocol'])?>');
updateDirection('<?=htmlspecialchars($pconfig['direction'])?>');
updateType('<?=htmlspecialchars($pconfig['type'])?>');
updateAction('<?=htmlspecialchars($pconfig['action'])?>');
updateProtocol('<?=htmlspecialchars($pconfig['protocol'])?>');
updateDirection('<?=htmlspecialchars($pconfig['direction'])?>');
updateType('<?=htmlspecialchars($pconfig['type'])?>');
updateAction('<?=htmlspecialchars($pconfig['action'])?>');
});
</script>
......@@ -406,18 +406,18 @@ jQuery(document).ready(function() {
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<form action="load_balancer_relay_action_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<div class="content-box">
<form action="load_balancer_relay_action_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 Action entry"); ?></td>
</tr>
......@@ -451,7 +451,7 @@ jQuery(document).ready(function() {
</select>
</td>
</tr>
<!-- Direction -->
<tr align="left" id="direction_row">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Direction"); ?></td>
......@@ -468,10 +468,10 @@ jQuery(document).ready(function() {
}
?>
</select>
</td>
</tr>
<!-- Type -->
<tr align="left" id="type_row"<?= $pconfig['protocol'] == "http" ? "" : " style=\"display:none;\""?>>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Type"); ?></td>
......@@ -492,7 +492,7 @@ jQuery(document).ready(function() {
</select>
</td>
</tr>
<!-- Action -->
<tr align="left" id="action_row"<?= $pconfig['protocol'] == "http" ? "" : " style=\"display:none;\""?>>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Action"); ?></td>
......@@ -505,9 +505,9 @@ jQuery(document).ready(function() {
if(isset($pconfig['action']) && $pconfig['action'] == $action) {
$selected = " selected";
} else if ($action == "change" ){
$selected = " selected";
} else {
$selected = "";
$selected = " selected";
} else {
$selected = "";
}
echo "<option id=\"{$dir}_{$type}_{$action}\" value=\"{$dir}_{$type}_{$action}\" onClick=\"updateAction('$action');\" style=\"display: none;\"{$selected}>{$action}</option>\n";
}
......@@ -585,4 +585,4 @@ jQuery(document).ready(function() {
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -88,7 +88,7 @@ if ($_GET['act'] == "del") {
/* 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]['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>";
......@@ -109,18 +109,18 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np(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
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
......@@ -130,11 +130,11 @@ include("head.inc");
$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="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">
<?
......@@ -152,12 +152,12 @@ include("head.inc");
$t->display();
?>
</div>
</form>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -105,7 +105,7 @@ if ($_POST) {
$protent = $a_protocol[$id];
if($protent['name'] != "")
$changedesc .= " " . sprintf(gettext("modified '%s' load balancing protocol:"), $protent['name']);
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']);
......@@ -119,12 +119,12 @@ if ($_POST) {
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;
}
}
if ($changecount > 0) {
/* Mark config dirty */
mark_subsystem_dirty('loadbalancer');
......@@ -189,18 +189,18 @@ jQuery(document).ready(function(){
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<div class="row">
<?php if ($input_errors) 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">
<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>
......@@ -267,7 +267,7 @@ jQuery(document).ready(function(){
<input class="formbtn" type="button" name="removeFromEnabled" value="<?=gettext("Remove"); ?>" onclick="deleteOption($('lbaction'));" />
</center>
</td>
<td>
<center>
<b><?=gettext("Enabled Actions"); ?></b>
......@@ -308,4 +308,4 @@ jQuery(document).ready(function(){
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -57,13 +57,13 @@ if ($_POST) {
$retval = 0;
$retval |= filter_configure();
$retval |= relayd_configure();
$savemsg = get_std_save_message($retval);
clear_subsystem_dirty('loadbalancer');
} else {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
if ($_POST['timeout'] && !is_numeric($_POST['timeout'])) {
$input_errors[] = gettext("Timeout must be a numeric value");
......@@ -73,7 +73,7 @@ if ($_POST) {
$input_errors[] = gettext("Interval must be a numeric value");
}
if ($_POST['prefork']) {
if ($_POST['prefork']) {
if (!is_numeric($_POST['prefork'])) {
$input_errors[] = gettext("Prefork must be a numeric value");
} else {
......@@ -89,8 +89,8 @@ if ($_POST) {
$lbsetting['interval'] = $_POST['interval'];
$lbsetting['prefork'] = $_POST['prefork'];
write_config();
mark_subsystem_dirty('loadbalancer');
write_config();
mark_subsystem_dirty('loadbalancer');
}
}
}
......@@ -106,18 +106,18 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_np(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
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Pools"), false, "load_balancer_pool.php");
......@@ -126,13 +126,13 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), true, "load_balancer_setting.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_setting.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_setting.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
......@@ -170,12 +170,12 @@ include("head.inc");
</tr>
</table>
</div>
</form>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -110,18 +110,18 @@ $main_buttons = array(
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('loadbalancer')): ?><br/>
<?php print_info_box_np(gettext("The virtual server 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
<?php
/* active tabs */
$tab_array = array();
$tab_array[] = array(gettext("Pools"), false, "load_balancer_pool.php");
......@@ -129,10 +129,10 @@ $main_buttons = array(
$tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Settings"), false, "load_balancer_setting.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_virtual_server.php" method="post" name="iform" id="iform">
?>
<div class="tab-content content-box col-xs-12">
<form action="load_balancer_virtual_server.php" method="post" name="iform" id="iform">
<div class="table-responsive">
......@@ -154,11 +154,11 @@ $main_buttons = array(
$t->display();
?>
</div>
</form>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -70,13 +70,13 @@ if ($_POST) {
/* input validation */
switch($pconfig['mode']) {
case "redirect": {
$reqdfields = explode(" ", "ipaddr name mode");
$reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Mode"));
break;
$reqdfields = explode(" ", "ipaddr name mode");
$reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Mode"));
break;
}
case "relay": {
$reqdfields = explode(" ", "ipaddr name mode relay_protocol");
$reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Relay Protocol"));
$reqdfields = explode(" ", "ipaddr name mode relay_protocol");
$reqdfieldsn = array(gettext("IP Address"),gettext("Name"),gettext("Relay Protocol"));
break;
}
}
......@@ -152,44 +152,44 @@ include("head.inc");
<body>
<?php include("fbegin.inc"); ?>
<script type="text/javascript" src="/javascript/autosuggest.js"></script>
<script type="text/javascript" src="/javascript/suggestions.js"></script>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<form action="load_balancer_virtual_server_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<div class="content-box">
<form action="load_balancer_virtual_server_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td colspan="3" valign="top" class="listtopic"><?=gettext("Edit Load Balancer - Virtual Server entry"); ?></td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"" . htmlspecialchars($pconfig['name']) . "\"";?> size="32" maxlength="32" />
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"" . htmlspecialchars($pconfig['descr']) . "\"";?> size="64" />
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP Address"); ?></td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP Address"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input class="formfldalias" id="ipaddr" name="ipaddr" type="text" <?if(isset($pconfig['ipaddr'])) echo "value=\"" . htmlspecialchars($pconfig['ipaddr']) . "\"";?> size="39" maxlength="39" />
<br /><?=gettext("This is normally the WAN IP address that you would like the server to listen on. All connections to this IP and port will be forwarded to the pool cluster."); ?>
......@@ -203,7 +203,7 @@ include("head.inc");
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncell"><?=gettext("Port"); ?></td>
<td width="22%" valign="top" class="vncell"><?=gettext("Port"); ?></td>
<td width="78%" class="vtable" colspan="2">
<input class="formfldalias" name="port" id="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"" . htmlspecialchars($pconfig['port']) . "\"";?> size="16" maxlength="16" />
<br /><?=gettext("This is the port that the clients will connect to. All connections to this port will be forwarded to the pool cluster."); ?>
......@@ -218,7 +218,7 @@ include("head.inc");
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Virtual Server Pool"); ?></td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Virtual Server Pool"); ?></td>
<td width="78%" class="vtable" colspan="2">
<?php if(count($config['load_balancer']['lbpool']) == 0): ?>
<b><?=gettext("NOTE:"); ?></b> <?=gettext("Please add a pool on the Pools tab to use this feature."); ?>
......@@ -237,22 +237,22 @@ include("head.inc");
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Fall Back Pool"); ?></td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Fall Back Pool"); ?></td>
<td width="78%" class="vtable" colspan="2">
<?php if(count($config['load_balancer']['lbpool']) == 0): ?>
<b><?=gettext("NOTE:"); ?></b> <?=gettext("Please add a pool on the Pools tab to use this feature."); ?>
<?php else: ?>
<select id="sitedown" name="sitedown">
<option value=""<?=htmlspecialchars($pconfig['sitedown']) == '' ? ' selected' : ''?>><?=gettext("none"); ?></option>
<?php
for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
$selected = "";
if ( $config['load_balancer']['lbpool'][$i]['name'] == $pconfig['sitedown'] )
$selected = " selected=\"selected\"";
<?php
for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
$selected = "";
if ( $config['load_balancer']['lbpool'][$i]['name'] == $pconfig['sitedown'] )
$selected = " selected=\"selected\"";
echo "<option value=\"" . htmlspecialchars($config['load_balancer']['lbpool'][$i]['name']) . "\"{$selected}>{$config['load_balancer']['lbpool'][$i]['name']}</option>";
}
?>
</select>
}
?>
</select>
<br /><?=gettext("The server pool to which clients will be redirected if *ALL* servers in the Virtual Server Pool are offline."); ?>
<br /><?=gettext("This option is NOT compatible with the DNS relay protocol."); ?>
<?php endif; ?>
......@@ -261,11 +261,11 @@ include("head.inc");
<tr style="display:none;"><td><input type="hidden" name="mode" value="redirect_mode" /></td></tr>
<!--
<tr align="left">
<td width="22%" valign="top" class="vncellreq">Mode</td>
<td width="22%" valign="top" class="vncellreq">Mode</td>
<td width="78%" class="vtable" colspan="2">
<input id="redirect_mode" type="radio" name="mode" value="redirect"<?=htmlspecialchars($pconfig['mode']) == 'redirect' ? ' checked="checked"': ''?> /> Redirect
<input id="relay_mode" type="radio" name="mode" value="relay"<?=htmlspecialchars($pconfig['mode']) == 'relay' ? ' checked="checked"': ''?> /> Relay
<br />
</td>
</tr>
......@@ -295,18 +295,18 @@ include("head.inc");
<?php if (isset($id) && $a_vs[$id] && $_GET['act'] != 'dup'): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
</td>
</td>
</tr>
</table>
</div>
<span class="red"><strong><?=gettext("Note:"); ?></strong></span> <?=gettext("Don't forget to add a firewall rule for the virtual server/pool after you're finished setting it up."); ?>
</div>
<span class="red"><strong><?=gettext("Note:"); ?></strong></span> <?=gettext("Don't forget to add a firewall rule for the virtual server/pool after you're finished setting it up."); ?>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?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