From 5793a8cd003643974206e44ea752ab0966cfa8c0 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 18 May 2013 16:05:43 +0200 Subject: integrate jsrrdgraph in CGP --- inc/collectd.inc.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'inc/collectd.inc.php') diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index ad15774..1df8bb0 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php @@ -169,12 +169,21 @@ function graphs_from_plugin($host, $plugin, $overview=false) { ? $CONFIG['time_range'][$plugin] : $CONFIG['time_range']['default']; - printf(''."\n", - $CONFIG['weburl'], - build_url('detail.php', $items, $time), - $CONFIG['weburl'], - build_url('graph.php', $items, $time) - ); + if ($CONFIG['graph_type'] == 'canvas') { + chdir($CONFIG['webdir']); + isset($items['p']) ? $_GET['p'] = $items['p'] : $_GET['p'] = ''; + isset($items['pi']) ? $_GET['pi'] = $items['pi'] : $_GET['pi'] = ''; + isset($items['t']) ? $_GET['t'] = $items['t'] : $_GET['t'] = ''; + isset($items['ti']) ? $_GET['ti'] = $items['ti'] : $_GET['ti'] = ''; + include $CONFIG['webdir'].'/plugin/'.$plugin.'.php'; + } else { + printf(''."\n", + $CONFIG['weburl'], + build_url('detail.php', $items, $time), + $CONFIG['weburl'], + build_url('graph.php', $items, $time) + ); + } } } -- cgit v1.1