summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-09-16 19:57:25 +0100
committerGitHub <noreply@github.com>2016-09-16 19:57:25 +0100
commitd99ceeac154627d2cfce94b51f1fd7d56fa44f9b (patch)
tree65909d05af2ee57362e30afa1b47ce0b57b360d7
parent561463d229f7f22c40d5bfb64d35c6559f6788cf (diff)
downloadpfsense-d99ceeac154627d2cfce94b51f1fd7d56fa44f9b.zip
pfsense-d99ceeac154627d2cfce94b51f1fd7d56fa44f9b.tar.gz
UI improvement - src port button label and src port help msgs
1. Rename "srcportadv" to "srcporttoggle" - not ideal to have 2 fields both labelled "advanced options". This presentation probably works nicer 2. Self-explanatory show/hide button itself doesn't need a label. (If srcports are shown, they will have a label as usual) 2. Move explanatory text about src port normally being un-needed to below src port, and simplify main help msgs. Mainly GUI text/labels improvement
-rw-r--r--src/usr/local/www/firewall_rules_edit.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 330191d..83ad5bb 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -1324,15 +1324,17 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
if ($type == 'src') {
$section->addInput(new Form_Button(
- 'btnsrcadv',
- 'Display Advanced',
+ 'btnsrctoggle',
+ '',
null,
'fa-cog'
- ))->setAttribute('type','button')->addClass('btn-info btn-sm');
+ ))->setAttribute('type','button')->addClass('btn-info btn-sm')->setHelp(
+ 'The source port (or port range) is usually random and almost never equal '.
+ 'to the destination port range. It is not usually required, and should usually '.
+ 'be left at its default value, <b>any</b>).');
}
$portValues = ['' => gettext('(other)'), 'any' => gettext('any')];
-
foreach ($wkports as $port => $portName) {
$portValues[$port] = $portName.' ('. $port .')';
}
@@ -1369,16 +1371,8 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
(isset($portValues[ $pconfig[$type .'endport'] ]) ? null : $pconfig[$type .'endport'])
))->setHelp('Custom');
-
- if ($type == 'src')
- $group->setHelp('Specify the source port or port range for this rule. This is '.
- 'usually random and almost never equal to the destination port range (and '.
- 'should usually be <b>any</b>). The "To" field may be left '.
- 'empty if only filtering a single port.');
- else
- $group->setHelp('Specify the destination port or port range for this rule. ' .
- 'The "To" field may be left empty if only filtering a '.
- 'single port.');
+ $group->setHelp('Specify the destination port or port range for this rule. ' .
+ 'The "To" field may be left empty if only filtering a single port.');
$group->addClass(($type == 'src') ? 'srcprtr':'dstprtr');
$section->add($group);
@@ -1798,7 +1792,7 @@ events.push(function() {
} else {
text = "<?=gettext('Display Advanced');?>";
}
- $('#btnsrcadv').html('<i class="fa fa-cog"></i> ' + text);
+ $('#btnsrctoggle').html('<i class="fa fa-cog"></i> ' + text);
}
function typesel_change() {
@@ -1884,7 +1878,7 @@ events.push(function() {
if ($('#proto').find(":selected").index() <= 2) {
hideClass('dstprtr', false);
- hideInput('btnsrcadv', false);
+ hideInput('btnsrctoggle', false);
if ((($('#srcbeginport').val() == "any") || ($('#srcbeginport').val() == "")) &&
(($('#srcendport').val() == "any") || ($('#srcendport').val() == ""))) {
srcportsvisible = false;
@@ -1893,7 +1887,7 @@ events.push(function() {
}
} else {
hideClass('dstprtr', true);
- hideInput('btnsrcadv', true);
+ hideInput('btnsrctoggle', true);
srcportsvisible = false;
}
@@ -1929,7 +1923,7 @@ events.push(function() {
ext_change();
});
- $('#btnsrcadv').click(function() {
+ $('#btnsrctoggle').click(function() {
srcportsvisible = !srcportsvisible;
show_source_port_range();
});
OpenPOWER on IntegriCloud