summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-10-03 09:29:32 -0400
committerSteve Beaver <sbeaver@netgate.com>2016-10-03 09:33:44 -0400
commit5c4c1fe5deffe78bf375646e89688cbd2b5e345b (patch)
tree78f6e3cf86a829098e9c3281edaa213a81c2261b /src
parente936f18c1ad0b847cc1133d376f9950f4770c360 (diff)
downloadpfsense-5c4c1fe5deffe78bf375646e89688cbd2b5e345b.zip
pfsense-5c4c1fe5deffe78bf375646e89688cbd2b5e345b.tar.gz
Fixed #6835 by revising Javascript show/hide
(cherry picked from commit 850c3d8b9352e7467beca8502c24ca8d4fbbbd29)
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/firewall_nat_out_edit.php32
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js10
2 files changed, 30 insertions, 12 deletions
diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php
index 1fc3a62..e0e0e80 100644
--- a/src/usr/local/www/firewall_nat_out_edit.php
+++ b/src/usr/local/www/firewall_nat_out_edit.php
@@ -574,7 +574,7 @@ $section->addInput(new Form_IpAddress(
'targetip',
'Other subnet',
$pconfig['targetip']
-))->addMask('targetip_subnet', $pconfig['targetip_subnet'])->addClass('othersubnet')->setHelp(
+))->addMask('targetip_subnet', $pconfig['targetip_subnet'])->setHelp(
'Packets matching this rule will be mapped to the IP address given here.' . '<br />' .
'To apply this rule to a different IP address than the IP address of the interface chosen above, ' .
'select it here (' .
@@ -603,6 +603,16 @@ $section->addInput(new Form_Select(
'<li>' . 'Sticky Address: The Sticky Address option can be used with the Random and Round Robin pool types to ensure that a particular source address is always mapped to the same translation address.' . '</li>' .
'</ul><span class="help-block">');
+<<<<<<< HEAD
+=======
+$section->addInput(new Form_Input(
+ 'source_hash_key',
+ 'Source Hash Key',
+ 'text',
+ $pconfig['source_hash_key']
+))->setHelp('The key that is fed to the hashing algorithm in hex format, preceeded by "0x", or any string. A non-hex string is hashed using md5 to a hexadecimal key. Defaults to a randomly generated value.')->setWidth(10);
+
+>>>>>>> 850c3d8... Fixed #6835 by revising Javascript show/hide
$group = new Form_Group('Port');
$group->addClass('natportgrp');
@@ -746,17 +756,33 @@ events.push(function() {
function poolopts_change() {
if ($('#target option:selected').text().trim().substring(0,4) == "Host") {
hideInput('poolopts', false);
- hideGroupClass('othersubnet', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
} else if ($('#target option:selected').text().trim().substring(0,6) == "Subnet") {
hideInput('poolopts', false);
- hideGroupClass('othersubnet', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
} else if ($('#target option:selected').text().trim().substring(0,5) == "Other") {
hideInput('poolopts', false);
+<<<<<<< HEAD
hideGroupClass('othersubnet', false);
} else {
$('#poolopts').prop('selectedIndex',0);
hideInput('poolopts', true);
hideGroupClass('othersubnet', true);
+=======
+ hideIpAddress('targetip', false);
+ if ($('#poolopts option:selected').text().trim().substring(0,6) == "Source") {
+ hideInput('source_hash_key', false);
+ }else {
+ hideInput('source_hash_key', true);
+ }
+ } else {
+ $('#poolopts').prop('selectedIndex',0);
+ hideInput('poolopts', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
+>>>>>>> 850c3d8... Fixed #6835 by revising Javascript show/hide
$('#targetip').val('');
$('#targetip_subnet').val('0');
}
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index 68b6899..6be2b68 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -90,14 +90,6 @@ function hideClass(s_class, hide) {
$('.' + s_class).show();
}
-// Hides all elements of the specified class assigned to a group. This will usually be a group
-function hideGroupClass(s_class, hide) {
- if (hide)
- $('.' + s_class).parent().parent().parent().hide();
- else
- $('.' + s_class).parent().parent().parent().show();
-}
-
function hideSelect(id, hide) {
if (hide)
$('#' + id).parent('div').parent('div').addClass('hidden');
@@ -112,7 +104,7 @@ function hideMultiCheckbox(id, hide) {
$("[name=" + id + "]").parent().removeClass('hidden');
}
-// Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden
+// Hides the <div> in which the specified IP address element lives so that the input, any mask selector, its label and help text are hidden
function hideIpAddress(id, hide) {
if (hide)
$('#' + id).parent().parent().parent('div').addClass('hidden');
OpenPOWER on IntegriCloud