diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-08-18 11:41:19 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-08-18 11:44:25 -0400 |
commit | c1f9ca7a73c562145f777b850bf3f4000f938c14 (patch) | |
tree | 113d57343b82f41c05166508bd1b416b68d5fe0b /src/usr/local/www/system.php | |
parent | 3d0a77036ce363e369aa360bb55c47cad2ccb2a5 (diff) | |
download | pfsense-c1f9ca7a73c562145f777b850bf3f4000f938c14.zip pfsense-c1f9ca7a73c562145f777b850bf3f4000f938c14.tar.gz |
Added control to set dashboard widget refresh period
Start each widget refresh system after a short random delay to prevent all widgets hitting the server at the exactsame time
Fix issues wherein two widgets were resetting the refresh timer from the AJAX call, not the call-back function, thereby risking stepping on themselves
(cherry picked from commit 512f2c10af716243046bdd08140856bb8e45222b)
Diffstat (limited to 'src/usr/local/www/system.php')
-rw-r--r-- | src/usr/local/www/system.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php index 0532347..836b73a 100644 --- a/src/usr/local/www/system.php +++ b/src/usr/local/www/system.php @@ -98,6 +98,7 @@ $pconfig['systemlogsmanagelogpanel'] = isset($config['system']['webgui']['system $pconfig['statusmonitoringsettingspanel'] = isset($config['system']['webgui']['statusmonitoringsettingspanel']); $pconfig['webguihostnamemenu'] = $config['system']['webgui']['webguihostnamemenu']; $pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']); +$pconfig['dashboardperiod'] = isset($config['widgets']['period']) ? $config['widgets']['period']:"10"; if (!$pconfig['timezone']) { if (isset($g['default_timezone']) && !empty($g['default_timezone'])) { @@ -145,6 +146,10 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); + if ($_POST['dashboardperiod']) { + $config['widgets']['period'] = $_POST['dashboardperiod']; + } + if ($_POST['webguicss']) { $config['system']['webgui']['webguicss'] = $_POST['webguicss']; } else { @@ -388,6 +393,7 @@ $section->addInput(new Form_Input( $pconfig['hostname'], ['placeholder' => 'pfSense'] ))->setHelp('Name of the firewall host, without domain part'); + $section->addInput(new Form_Input( 'domain', 'Domain', @@ -397,6 +403,7 @@ $section->addInput(new Form_Input( ))->setHelp('Do not use \'local\' as a domain name. It will cause local '. 'hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve '. 'local hosts not running mDNS.'); + $form->add($section); $section = new Form_Section('DNS Server Settings'); @@ -473,12 +480,14 @@ $section->addInput(new Form_Checkbox( $form->add($section); $section = new Form_Section('Localization'); + $section->addInput(new Form_Select( 'timezone', 'Timezone', $pconfig['timezone'], array_combine($timezonelist, $timezonelist) ))->setHelp('Select the timezone or location within the timezone to be used by this system.'); + $section->addInput(new Form_Input( 'timeservers', 'Timeservers', @@ -486,6 +495,7 @@ $section->addInput(new Form_Input( $pconfig['timeservers'] ))->setHelp('Use a space to separate multiple hosts (only one required). '. 'Remember to set up at least one DNS server if a host name is entered here!'); + $section->addInput(new Form_Select( 'language', 'Language', @@ -509,6 +519,16 @@ gen_associatedpanels_fields( $pconfig['statusmonitoringsettingspanel']); gen_webguileftcolumnhyper_field($section, $pconfig['webguileftcolumnhyper']); +$section->addInput(new Form_Input( + 'dashboardperiod', + 'Dashboard update period', + 'number', + $pconfig['dashboardperiod'], + ['min' => '10', 'max' => '600'] +))->setHelp('Time in seconds between dashboard widget updates. Small values cause ' . + 'more frequent updates but increase the load on the web server. ' . + 'Minimum is 5 seconds, maximum 600 seconds'); + $form->add($section); print $form; |