diff options
author | Ermal <eri@pfsense.org> | 2011-07-28 20:31:46 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-07-28 20:31:46 +0000 |
commit | b8873098b97cd780577398071a6388338fdaa088 (patch) | |
tree | af043fda7206a2b6abf1004906a2bf6c03af4275 /usr/local | |
parent | b9f9852600d595e9b7cb03e03b924b228e1e6554 (diff) | |
download | pfsense-b8873098b97cd780577398071a6388338fdaa088.zip pfsense-b8873098b97cd780577398071a6388338fdaa088.tar.gz |
Add a new option to allow disabling of gateway monitoring. This gateways will always be reported as up.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 7ded7ae..7514298 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -78,6 +78,7 @@ if (isset($id) && $a_gateways[$id]) { $pconfig['losshigh'] = $a_gateway_item[$id]['losshigh']; $pconfig['down'] = $a_gateway_item[$id]['down']; $pconfig['monitor'] = $a_gateways[$id]['monitor']; + $pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']); $pconfig['descr'] = $a_gateways[$id]['descr']; $pconfig['attribute'] = $a_gateways[$id]['attribute']; } @@ -221,7 +222,9 @@ if ($_POST) { $gateway['name'] = $_POST['name']; $gateway['weight'] = $_POST['weight']; $gateway['descr'] = $_POST['descr']; - if (is_ipaddr($_POST['monitor'])) + if ($_POST['monitor_disable'] == "yes") + $gateway['monitor_disable'] = true; + else if (is_ipaddr($_POST['monitor'])) $gateway['monitor'] = $_POST['monitor']; if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") { @@ -287,6 +290,9 @@ function show_advanced_gateway() { aodiv = document.getElementById('showgatewayadv'); aodiv.style.display = "block"; } +function monitor_change() { + document.iform.monitor.disabled = document.iform.monitor_disable.checked; +} </script> <?php if ($input_errors) print_input_errors($input_errors); ?> <form action="system_gateways_edit.php" method="post" name="iform" id="iform"> @@ -346,6 +352,14 @@ function show_advanced_gateway() { </td> </tr> <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Disable Gateway Monitoring"); ?></td> + <td width="78%" class="vtable"> + <input name="monitor_disable" type="checkbox" id="monitor_disable" value="yes" <?php if ($pconfig['monitor_disable'] == true) echo "checked"; ?> onClick="monitor_change()" /> + <strong><?=gettext("Disable Gateway Monitoring"); ?></strong><br /> + <?=gettext("This will consider this gateway as always being up"); ?> + </td> + </tr> + <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Monitor IP"); ?></td> <td width="78%" class="vtable"> <?php @@ -441,7 +455,7 @@ function show_advanced_gateway() { </form> <?php include("fend.inc"); ?> <script language="JavaScript"> -enable_change(document.iform.defaultgw); +monitor_change(); </script> </body> </html> |