From 77134809c3e9c33132ec832927cdbfb73d4ac1da Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Wed, 26 Aug 2015 18:58:56 -0400 Subject: Fixed #5020 --- src/usr/local/www/firewall_rules_edit.php | 42 ++++++++++++++++++++++---- src/usr/local/www/system_advanced_firewall.php | 40 +++++++++++++++++++++--- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 1f6c1d1..8688012 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1501,12 +1501,13 @@ $section->addInput(new Form_Select( 'State type', $pconfig['statetype'], array( - 'keep state' => 'Keep: works with all IP protocols', - 'sloppy state' => 'Sloppy: works with all IP protocols', - 'synproxy state' => 'Synproxy: proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined', - 'none' => 'None: Do not use state mechanisms to keep track. This is only useful if you\'re doing advanced queueing in certain situations', + 'keep state' => 'Keep', + 'sloppy state' => 'Sloppy', + 'synproxy state' => 'Synproxy', + 'none' => 'None', ) -))->setHelp('Select which type of state tracking mechanism you would like to use. If in doubt, use keep state.'); +))->setHelp('Select which type of state tracking mechanism you would like to use. If in doubt, use keep state' . '
' . + ''); $section->addInput(new Form_Checkbox( 'nosync', @@ -1940,7 +1941,36 @@ events.push(function(){ $('.table-flags').addClass('hidden'); else $('.table-flags').removeClass('hidden'); - }); + }); + + // Change help text based on the selector value + function setHelpText(id, text) { + $('#' + id).parent().parent('div').find('span').find('span').html(text); + } + + function setOptText(target, val) { + var dispstr = ''; + + if(val == 'keep state') + dispstr += 'Keep: works with all IP protocols'; + else if (val == 'sloppy state') + dispstr += 'Sloppy: works with all IP protocols'; + else if (val == 'synproxy state') + dispstr += 'Synproxy: proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined'; + else if (val == 'none') + dispstr += 'None: Do not use state mechanisms to keep track. This is only useful if you\'re doing advanced queueing in certain situations'; + + dispstr += ''; + setHelpText(target, dispstr); + } + + // On click . . + $('#statetype').on('change', function() { + setOptText('statetype', this.value); + }); + + // At page load . . + setOptText('statetype', $('#statetype').val()) }); //]]> diff --git a/src/usr/local/www/system_advanced_firewall.php b/src/usr/local/www/system_advanced_firewall.php index a31bfab..3b41965 100644 --- a/src/usr/local/www/system_advanced_firewall.php +++ b/src/usr/local/www/system_advanced_firewall.php @@ -426,10 +426,10 @@ $section->addInput($input = new Form_Select( 'Firewall Optimization Options', $config['system']['optimization'], array( - 'normal' => 'normal: the default optimization algorithm', - 'high-latency' => 'high-latency: used for eg. satellite links. Expires idle connections later than default', - 'aggressive' => 'aggressive: expires idle connections quicker. More efficient use of CPU and memory but can drop legitimate idle connections', - 'conservative' => 'conservative: tries to avoid dropping any legitimate idle connections at the expense of increased memory usage and CPU utilization.', + 'normal' => 'Normal', + 'high-latency' => 'High-latency', + 'aggressive' => 'Aggressive', + 'conservative' => 'Conservative', ) ))->setHelp('Select the type of state table optimization to use'); @@ -711,4 +711,36 @@ foreach ($udpTimeouts as $name) $section->add($group); print $form; + +?> + +