diff options
author | Pim van den Berg | 2010-06-26 17:03:43 +0200 |
---|---|---|
committer | Pim van den Berg | 2010-06-26 17:03:43 +0200 |
commit | 84005a744d2d6073296ab3fe7d3aa670a0cfe61b (patch) | |
tree | 94787f0ffdf16db45904f77926780e575465b5c9 /inc/collectd.inc.php | |
parent | Fix typo: Celsius instead of Celius (diff) | |
download | apt-panopticon_cgp-84005a744d2d6073296ab3fe7d3aa670a0cfe61b.zip apt-panopticon_cgp-84005a744d2d6073296ab3fe7d3aa670a0cfe61b.tar.gz apt-panopticon_cgp-84005a744d2d6073296ab3fe7d3aa670a0cfe61b.tar.bz2 apt-panopticon_cgp-84005a744d2d6073296ab3fe7d3aa670a0cfe61b.tar.xz |
default graph time range is now configurable (not only for uptime)
Diffstat (limited to 'inc/collectd.inc.php')
-rw-r--r-- | inc/collectd.inc.php | 8 |
1 files changed, 5 insertions, 3 deletions
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) { | |||
130 | 130 | ||
131 | $time = array_key_exists($plugin, $CONFIG['time_range']) | 131 | $time = array_key_exists($plugin, $CONFIG['time_range']) |
132 | ? $CONFIG['time_range'][$plugin] | 132 | ? $CONFIG['time_range'][$plugin] |
133 | : 86400; | 133 | : $CONFIG['time_range']['default']; |
134 | 134 | ||
135 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", | 135 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", |
136 | $CONFIG['weburl'], | 136 | $CONFIG['weburl'], |
@@ -144,12 +144,14 @@ function graphs_from_plugin($host, $plugin) { | |||
144 | } | 144 | } |
145 | 145 | ||
146 | # generate an url with GET values from $items | 146 | # generate an url with GET values from $items |
147 | function build_url($base, $items, $s=86400) { | 147 | function build_url($base, $items, $s=NULL) { |
148 | global $CONFIG; | ||
149 | |||
148 | if (!is_array($items)) | 150 | if (!is_array($items)) |
149 | return false; | 151 | return false; |
150 | 152 | ||
151 | if (!is_numeric($s)) | 153 | if (!is_numeric($s)) |
152 | return false; | 154 | $s = $CONFIG['time_range']['default']; |
153 | 155 | ||
154 | $i=0; | 156 | $i=0; |
155 | foreach ($items as $key => $value) { | 157 | foreach ($items as $key => $value) { |