diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 927dc5fc63..18a4a1c71f 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -997,8 +997,8 @@ function convert_config() { $config['version'] = "2.9"; } - /* Convert 2.9 -> 3.0 */ - if ($config['version'] <= 2.9) { + /* Convert 2.9 -> 4.0 */ + if ($config['version'] <= 3.9) { $config['system']['webgui']['auth_method'] = "session"; $config['system']['webgui']['backing_method'] = "htpasswd"; @@ -1043,13 +1043,13 @@ function convert_config() { unset ($config['system']['username']); unset ($config['system']['password']); - $config['version'] = "3.0"; + $config['version'] = "4.0"; } } - /* Convert 3.0 -> 3.1 */ - if ($config['version'] <= 3.0) { + /* Convert 4.0 -> 4.1 */ + if ($config['version'] <= 4.0) { if(!$config['sysctl']) { $config['sysctl']['item'] = array(); @@ -1122,11 +1122,18 @@ function convert_config() { $config['sysctl']['item'][16]['desc'] = "The system will attempt to calculate the bandwidth delay product for each connection and limit the amount of data queued to the network to just the amount required to maintain optimum throughput. "; $config['sysctl']['item'][16]['value'] = "3"; - $config['version'] = "3.1"; + $config['version'] = "4.1"; } } + /* Convert 4.1 -> 4.2 */ + if ($config['version'] <= 4.1) { + /* enable the rrd config setting by default */ + $config['rrd']['enable'] = true; + $config['version'] = "4.2"; + } + if ($prev_version != $config['version']) write_config("Upgraded config version level from {$prev_version} to {$config['version']}"); } diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 186edef85b..a4419ceee8 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -8,7 +8,7 @@ * $Id$ ****** * - * Copyright (C) 2004-2006 Scott Ullrich (sullrich@gmail.com) + * Copyright (C) 2004-2007 Scott Ullrich (sullrich@gmail.com) * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2914,8 +2914,6 @@ function enable_rrd_graphing() { $rrdrestore = ""; $rrdreturn = ""; - $config['rrd']['enable'] = true; - if (isset ($config['rrd']['enable'])) { /* create directory if needed */ diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 96efa1eb56..9d5428a503 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2006 Seth Mos + Copyright (C) 2007 Seth Mos All rights reserved. Redistribution and use in source and binary forms, with or without @@ -33,7 +33,11 @@ require("guiconfig.inc"); if ($_GET['cat']) { $curcat = $_GET['cat']; } else { - $curcat = "system"; + if(! empty($config['rrd']['category'])) { + $curcat = $config['rrd']['category']; + } else { + $curcat = "system"; + } } if ($_GET['option']) { @@ -51,7 +55,11 @@ if ($_GET['option']) { if ($_GET['style']) { $curstyle = $_GET['style']; } else { - $curstyle = "inverse"; + if(! empty($config['rrd']['style'])) { + $curstyle = $config['rrd']['style']; + } else { + $curstyle = "inverse"; + } } $rrddbpath = "/var/db/rrd/"; @@ -103,6 +111,8 @@ include("head.inc"); $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); + if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php"); display_top_tabs($tab_array); ?> diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index fdf07a9149..12638e4888 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -3,7 +3,7 @@ /* status_rrd_graph_img.php Part of pfSense - Copyright (C) 2006 Seth Mos + Copyright (C) 2007 Seth Mos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php new file mode 100755 index 0000000000..6a386ad726 --- /dev/null +++ b/usr/local/www/status_rrd_graph_settings.php @@ -0,0 +1,165 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +require("guiconfig.inc"); + +$pconfig['enable'] = isset($config['rrd']['enable']); +$pconfig['category'] = isset($config['rrd']['category']); +$pconfig['style'] = isset($config['rrd']['style']); + +$curcat = "settings"; +$categories = array('system' => 'System', + 'traffic' => 'Traffic', + 'packets' => 'Packets', + 'quality' => 'Quality', + 'queues' => 'Queues'); +$styles = array('inverse' => 'Inverse', + 'absolute' => 'Absolute'); + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + /* input validation */ + /* none */ + + if (!$input_errors) { + $config['rrd']['enable'] = $_POST['enable'] ? true : false; + $config['rrd']['category'] = $_POST['category']; + $config['rrd']['style'] = $_POST['style']; + write_config(); + + $retval = 0; + config_lock(); + $retval = enable_rrd_graphing(); + config_unlock(); + + $savemsg = get_std_save_message($retval); + } +} + +$pgtitle = gettext("Status: RRD Graphs"); +include("head.inc"); + +?> + + + + +

+ + +
+ + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
RRD Graphs + onClick="enable_change(false)"> + +
Default category + + +
Default style + + +
  + +
 Note:
+ +
+
+
+ +
+ + +