From 84005a744d2d6073296ab3fe7d3aa670a0cfe61b Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 26 Jun 2010 17:03:43 +0200 Subject: default graph time range is now configurable (not only for uptime) --- inc/collectd.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'inc/collectd.inc.php') diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 4e5d0e4..f5769c0 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php @@ -130,7 +130,7 @@ function graphs_from_plugin($host, $plugin) { $time = array_key_exists($plugin, $CONFIG['time_range']) ? $CONFIG['time_range'][$plugin] - : 86400; + : $CONFIG['time_range']['default']; printf(''."\n", $CONFIG['weburl'], @@ -144,12 +144,14 @@ function graphs_from_plugin($host, $plugin) { } # generate an url with GET values from $items -function build_url($base, $items, $s=86400) { +function build_url($base, $items, $s=NULL) { + global $CONFIG; + if (!is_array($items)) return false; if (!is_numeric($s)) - return false; + $s = $CONFIG['time_range']['default']; $i=0; foreach ($items as $key => $value) { -- cgit v1.1