aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
authorPim van den Berg2014-11-11 23:01:15 +0100
committerPim van den Berg2014-11-11 23:01:15 +0100
commit82d88098f4203cf7402d4faf5ad100cada70efaf (patch)
tree0c7e63a0e91493837dad20a802529b3051bd670a /inc
parenttype/base: allow rrdtool graph -l (lower-limit) to be configured via config o... (diff)
downloadapt-panopticon_cgp-82d88098f4203cf7402d4faf5ad100cada70efaf.zip
apt-panopticon_cgp-82d88098f4203cf7402d4faf5ad100cada70efaf.tar.gz
apt-panopticon_cgp-82d88098f4203cf7402d4faf5ad100cada70efaf.tar.bz2
apt-panopticon_cgp-82d88098f4203cf7402d4faf5ad100cada70efaf.tar.xz
make detail page accessible when using "canvas" graph_type
Closes #106
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.inc.php10
-rw-r--r--inc/html.inc.php8
2 files changed, 18 insertions, 0 deletions
diff --git a/inc/functions.inc.php b/inc/functions.inc.php
index abe0763..df02d20 100644
--- a/inc/functions.inc.php
+++ b/inc/functions.inc.php
@@ -59,3 +59,13 @@ function error_image() {
59 readfile('layout/error.png'); 59 readfile('layout/error.png');
60 exit; 60 exit;
61} 61}
62
63function generate_uuid() {
64 return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
65 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
66 mt_rand( 0, 0xffff ),
67 mt_rand( 0, 0x0fff ) | 0x4000,
68 mt_rand( 0, 0x3fff ) | 0x8000,
69 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
70 );
71}
diff --git a/inc/html.inc.php b/inc/html.inc.php
index 161af73..bc22ba3 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -338,7 +338,15 @@ function graphs_from_plugin($host, $plugin, $overview=false) {
338 isset($items['t']) ? $_GET['t'] = $items['t'] : $_GET['t'] = ''; 338 isset($items['t']) ? $_GET['t'] = $items['t'] : $_GET['t'] = '';
339 isset($items['ti']) ? $_GET['ti'] = $items['ti'] : $_GET['ti'] = ''; 339 isset($items['ti']) ? $_GET['ti'] = $items['ti'] : $_GET['ti'] = '';
340 $_GET['s'] = $time; 340 $_GET['s'] = $time;
341 $uuid = generate_uuid();
342 printf('<canvas id="%s" class="rrd">', $uuid);
341 include $CONFIG['webdir'].'/graph.php'; 343 include $CONFIG['webdir'].'/graph.php';
344 print '</canvas>';
345 printf('<a href="%s%s"><img id="%s-img" alt="graph"></a>'."\n",
346 htmlentities($CONFIG['weburl']),
347 htmlentities(build_url('detail.php', $items, $time)),
348 $uuid
349 );
342 } else { 350 } else {
343 printf('<a href="%1$s%2$s"><img src="%1$s%3$s"></a>'."\n", 351 printf('<a href="%1$s%2$s"><img src="%1$s%3$s"></a>'."\n",
344 htmlentities($CONFIG['weburl']), 352 htmlentities($CONFIG['weburl']),