summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-08-10 17:18:50 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-08-10 17:18:50 -0300
commita9d5bf0cab6016341655999001d3c672a6a4970c (patch)
tree34fa031ed8fb4e523b9b06453001d41eb4e7bac0 /usr/local/www
parent55f88b5120e4ac16de3ffcf91cf9054248bf2497 (diff)
parentc2d0699fef933b8b0eaf3e0f17e49a541900c743 (diff)
downloadpfsense-a9d5bf0cab6016341655999001d3c672a6a4970c.zip
pfsense-a9d5bf0cab6016341655999001d3c672a6a4970c.tar.gz
Merge remote branch 'mainline/master'
Conflicts: usr/local/www/status_lb_pool.php
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_nanobsd.php53
-rwxr-xr-xusr/local/www/fbegin.inc2
-rwxr-xr-xusr/local/www/firewall_virtual_ip_edit.php6
-rwxr-xr-xusr/local/www/interfaces_assign.php2
-rwxr-xr-xusr/local/www/load_balancer_monitor.php2
-rwxr-xr-xusr/local/www/load_balancer_pool.php2
-rwxr-xr-xusr/local/www/load_balancer_virtual_server.php2
-rwxr-xr-xusr/local/www/status_lb_pool.php71
8 files changed, 121 insertions, 19 deletions
diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php
index db96484..2ddcf9e 100755
--- a/usr/local/www/diag_nanobsd.php
+++ b/usr/local/www/diag_nanobsd.php
@@ -100,6 +100,16 @@ EOF;
nanobsd_detect_slice_info();
}
+if (isset($_POST['rrdbackup'])) {
+ $config['system']['rrdbackup'] = $_POST['rrdbackup'];
+ install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
+}
+if (isset($_POST['dhcpbackup'])) {
+ $config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
+ install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
+}
+
+
if ($savemsg)
print_info_box($savemsg)
@@ -165,6 +175,49 @@ if ($savemsg)
<tr>
<td valign="top" class="">&nbsp;</td><td><br/><input type='submit' value='Duplicate slice'></form></td>
</tr>
+ <tr>
+ <td colspan="2" valign="top" class="">&nbsp;</td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Periodic Data Backup");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("RRD Backup");?></td>
+ <td width="78%" class="vtable">
+ <form action="diag_nanobsd.php" method="post" name="iform">
+ <?=gettext("Frequency");?>:
+ <select name='rrdbackup'>
+ <option value='0' <? if (!isset($config['system']['rrdbackup']) || ($config['system']['rrdbackup'] == 0)) echo "selected"; ?>>Disable</option>
+ <? for ($x=1; $x<=24; $x++) { ?>
+ <option value='<?= $x ?>' <? if ($config['system']['rrdbackup'] == $x) echo "selected"; ?>><?= $x ?> hour<? if ($x>1) echo "s"; ?></option>
+ <? } ?>
+ </select>
+ <br/>
+ <?=gettext("This will peridoically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
+ <br/>
+ <br/>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("DHCP Leases Backup");?></td>
+ <td width="78%" class="vtable">
+ <form action="diag_nanobsd.php" method="post" name="iform">
+ <?=gettext("Frequency");?>:
+ <select name='dhcpbackup'>
+ <option value='0' <? if (!isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0)) echo "selected"; ?>>Disable</option>
+ <? for ($x=1; $x<=24; $x++) { ?>
+ <option value='<?= $x ?>' <? if ($config['system']['dhcpbackup'] == $x) echo "selected"; ?>><?= $x ?> hour<? if ($x>1) echo "s"; ?></option>
+ <? } ?>
+ </select>
+ <br/>
+ <?=gettext("This will peridoically backup the DHCP leases data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
+ <br/>
+ <br/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="">&nbsp;</td><td><br/><input type='submit' value='Save'></form></td>
+ </tr>
<?php if(file_exists("/conf/upgrade_log.txt")): ?>
<tr>
<td colspan="2" valign="top" class="">&nbsp;</td>
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index 9bcc8b5..fa8f9d4 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -121,7 +121,7 @@ if($g['services_dhcp_server_enable'])
$services_menu[] = array("DHCP Server", "/services_dhcp.php");
$services_menu[] = array("Dynamic DNS", "/services_dyndns.php");
$services_menu[] = array("IGMP proxy", "/services_igmpproxy.php");
-$services_menu[] = array("Load Balancer", "/load_balancer_monitor.php");
+$services_menu[] = array("Load Balancer", "/load_balancer_pool.php");
$services_menu[] = array("OLSR", "/pkg_edit.php?xml=olsrd.xml&id=0");
$services_menu[] = array("PPPoE Server", "/vpn_pppoe.php");
$services_menu[] = array("RIP", "/pkg_edit.php?xml=routed/routed.xml&id=0");
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index 1781518..6a7c198 100755
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -248,9 +248,9 @@ function get_radio_value(obj)
}
function enable_change(enable_over) {
var note = document.getElementById("typenote");
- var carpnote = document.createTextNode('<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>');
- var proxyarpnote = document.createTextNode('<?=gettext("This is a CIDR block of proxy ARP addresses.");?>');
- var ipaliasnote = document.createTextNode('<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>');
+ var carpnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
+ var proxyarpnote = document.createTextNode("<?=gettext("This is a CIDR block of proxy ARP addresses.");?>");
+ var ipaliasnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
if ((get_radio_value(document.iform.mode) == "carp") || enable_over) {
document.iform.vhid.disabled = 0;
document.iform.password.disabled = 0;
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index aef014a..9addbfa 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -317,7 +317,7 @@ if ($_GET['act'] == "add") {
break;
}
$newifname = 'opt' . $i;
- $descr = sprintf(gettext("OPT '%s'"),$i);
+ $descr = "OPT" . $i;
$config['interfaces'][$newifname] = array();
$config['interfaces'][$newifname]['descr'] = $descr;
}
diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php
index f4c1411..987192c 100755
--- a/usr/local/www/load_balancer_monitor.php
+++ b/usr/local/www/load_balancer_monitor.php
@@ -106,9 +106,9 @@ include("head.inc");
<?php
/* active tabs */
$tab_array = array();
- $tab_array[] = array(gettext("Monitors"), true, "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("Monitors"), true, "load_balancer_monitor.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php
index 81901d1..48dccd6 100755
--- a/usr/local/www/load_balancer_pool.php
+++ b/usr/local/www/load_balancer_pool.php
@@ -115,9 +115,9 @@ include("head.inc");
<?php
/* active tabs */
$tab_array = array();
- $tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
$tab_array[] = array(gettext("Pools"), true, "load_balancer_pool.php");
$tab_array[] = array(gettext("Virtual Servers"), false, "load_balancer_virtual_server.php");
+ $tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php
index 41cc36e..51cc9da 100755
--- a/usr/local/www/load_balancer_virtual_server.php
+++ b/usr/local/www/load_balancer_virtual_server.php
@@ -114,9 +114,9 @@ include("head.inc");
<?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"), true, "load_balancer_virtual_server.php");
+ $tab_array[] = array(gettext("Monitors"), false, "load_balancer_monitor.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php
index 54f3398..c5884bb 100755
--- a/usr/local/www/status_lb_pool.php
+++ b/usr/local/www/status_lb_pool.php
@@ -58,6 +58,21 @@ $year = date("Y");
$pgtitle = array(gettext("Status"),gettext("Load Balancer"),gettext("Pool"));
include("head.inc");
+$relayctl=split("\n", shell_exec("/usr/local/sbin/relayctl show summary"));
+$relay_hosts=Array();
+foreach( (array) $relayctl as $line) {
+ $t=split("\t", $line);
+ switch (trim($t[1])) {
+ case "table":
+ $curpool=trim($t[2]);
+ break;
+ case "host":
+ $curhost=trim($t[2]);
+ $relay_hosts[$curpool][$curhost]['state']=trim($t[4]);
+ break;
+ }
+}
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<script src="/javascript/sorttable.js"></script>
@@ -77,31 +92,66 @@ include("head.inc");
<div id="mainarea">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" name="sortabletable" id="sortabletable">
<tr>
- <td width="10%" class="listhdrr"><?=gettext("Name");?></td>
- <td width="10%" class="listhdrr"><?=gettext("Type");?></td>
- <td width="10%" class="listhdrr"><?=gettext("Gateways");?></td>
- <td width="30%" class="listhdrr"><?=gettext("Status");?></td>
- <td width="30%" class="listhdr"><?=gettext("Description");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Name");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Mode");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Servers");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Monitor");?></td>
+ <td width="30%" class="listhdr"><?=gettext("Description");?></td>
</tr>
<?php $i = 0; foreach ($a_pool as $vipent):
- if ($vipent['type'] == "gateway") {
+ $svr=($vipent['servers'][0]);
+ if(trim($svr)=='10.1.10.101')
+ $vipent['mode']='loadbalance';
+ if(trim($svr)=='10.1.10.121')
+ $vipent['mode']='failover';
?>
<tr>
<td class="listlr">
<?=$vipent['name'];?>
</td>
<td class="listr" align="center" >
- <?=$vipent['type'];?>
- <br />
- (<?=$vipent['behaviour'];?>)
+ <?php
+ switch($vipent['mode']) {
+ case "loadbalance":
+ echo "Load balancing";
+ break;
+ case "failover":
+ echo "Manual failover";
+ break;
+ default:
+ echo "(default)";
+ }
+ ?>
</td>
<td class="listr" align="center" >
<table border="0" cellpadding="0" cellspacing="2">
<?php
foreach ((array) $vipent['servers'] as $server) {
$svr = split("\|", $server);
- PRINT "<tr><td> {$svr[0]} </td></tr>";
+ if($svr[0]!="") {
+ switch ($relay_hosts[$vipent['name'].":".$vipent['port']][$svr[0]]['state']) {
+ case 'up':
+ $bgcolor = "lightgreen";
+ break;
+ default:
+ $bgcolor = "lightcoral";
+ }
+ PRINT "<tr>";
+ switch ($vipent['mode']) {
+ case 'loadbalance':
+ if($svr[0]!="") PRINT "<td><input type='checkbox' name='".$vipent['name']."_".$svr[0]."' checked=1></td>";
+ break;
+ case 'failover':
+ if($svr[0]!="") PRINT "<td><input type='radio' name='".$vipent['name']."' selected></td>";
+ break;
+ }
+ PRINT "<td bgcolor=".$bgcolor."> {$svr[0]}:{$vipent['port']} </td></tr>";
+ }
}
+ foreach ((array) $vipent['serversdisabled'] as $server) {
+ $svr = split("\|", $server);
+ if($svr[0]!="") PRINT "<tr><td><input type='checkbox'></td><td> {$svr[0]}:{$vipent['port']} </td></tr>";
+ }
?>
</table>
</td>
@@ -155,7 +205,6 @@ include("head.inc");
</td>
</tr>
<?php
- }
$i++;
endforeach;
?>
OpenPOWER on IntegriCloud