diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index df7a5d135e..4bfff3d3bb 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -210,6 +210,44 @@ $config['int_l2tp'] = 0; # Enable L2TP Port Types ``` Enable / disable certain menus from being shown in the WebUI. +You are able to adjust the number and time frames of the quick select time options for graphs and the mini graphs shown per row. + +Quick select: +```php +$config['graphs']['mini']['normal'] = array( + 'day' => '24 Hours', + 'week' => 'One Week', + 'month' => 'One Month', + 'year' => 'One Year', +); +$config['graphs']['mini']['widescreen'] = array( + 'sixhour' => '6 Hours', + 'day' => '24 Hours', + 'twoday' => '48 Hours', + 'week' => 'One Week', + 'twoweek' => 'Two Weeks', + 'month' => 'One Month', + 'twomonth' => 'Two Months', + 'year' => 'One Year', + 'twoyear' => 'Two Years', +); +``` + +Mini graphs: +```php +$config['graphs']['row']['normal'] = array( + 'sixhour' => '6 Hours', + 'day' => '24 Hours', + 'twoday' => '48 Hours', + 'week' => 'One Week', + 'twoweek' => 'Two Weeks', + 'month' => 'One Month', + 'twomonth' => 'Two Months', + 'year' => 'One Year', + 'twoyear' => 'Two Years', +); +``` + ```php $config['web_mouseover'] = true; ``` diff --git a/html/includes/print-graphrow.inc.php b/html/includes/print-graphrow.inc.php index 230dbba95d..800281ed0d 100644 --- a/html/includes/print-graphrow.inc.php +++ b/html/includes/print-graphrow.inc.php @@ -11,14 +11,7 @@ if ($_SESSION['widescreen']) { $graph_array['width'] = '215'; } - $periods = array( - 'sixhour', - 'day', - 'week', - 'month', - 'year', - 'twoyear', - ); + $periods = $config['graphs']['mini']['widescreen']; } else { if (!$graph_array['height']) { $graph_array['height'] = '100'; @@ -28,12 +21,7 @@ if ($_SESSION['widescreen']) { $graph_array['width'] = '215'; } - $periods = array( - 'day', - 'week', - 'month', - 'year', - ); + $periods = $config['graphs']['mini']['normal']; }//end if if ($_SESSION['screen_width']) { @@ -53,7 +41,7 @@ $graph_array['height'] = round($graph_array['width'] /2.15); $graph_array['to'] = $config['time']['now']; $graph_data = array(); -foreach ($periods as $period) { +foreach ($periods as $period => $period_tex) { $graph_array['from'] = $config['time'][$period]; $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = '150'; diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index a56736dc2c..1f03b37735 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -73,8 +73,7 @@ if (!$auth) { print_optionbar_start(); - $thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks', - 'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years'); + $thumb_array = $config['graphs']['row']['normal']; echo ''; diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 1f76748fcf..f86f11956c 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -354,6 +354,28 @@ $config['network_map_legend'] = array( '100' => '#ff0000', ); +// Default mini graph time options: +$config['graphs']['mini']['widescreen'] = array( + 'sixhour' => '6 Hours', + 'day' => '24 Hours', + 'twoday' => '48 Hours', + 'week' => 'One Week', + 'twoweek' => 'Two Weeks', + 'month' => 'One Month', + 'twomonth' => 'Two Months', + 'year' => 'One Year', + 'twoyear' => 'Two Years', +); + +$config['graphs']['mini']['normal'] = array( + 'day' => '24 Hours', + 'week' => 'One Week', + 'month' => 'One Month', + 'year' => 'One Year', +); + +$config['graphs']['row']['normal'] = $config['graphs']['mini']['widescreen']; + // Network Map Items $config['network_map_items'] = array('xdp','mac'); diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 95f1a1e5c1..485df1e1ad 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -689,6 +689,8 @@ if (isset($_SERVER['HTTPS'])) { // Set some times needed by loads of scripts (it's dynamic, so we do it here!) $config['time']['now'] = time(); $config['time']['now'] -= ($config['time']['now'] % 300); +$config['time']['onehour'] = ($config['time']['now'] - 3600); +// time() - (1 * 60 * 60); $config['time']['fourhour'] = ($config['time']['now'] - 14400); // time() - (4 * 60 * 60); $config['time']['sixhour'] = ($config['time']['now'] - 21600);