mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
print graph when debugging graph.php. (shiny, eh?)
git-svn-id: http://www.observium.org/svn/observer/trunk@2932 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function data_uri($file, $mime)
|
||||||
|
{
|
||||||
|
$contents = file_get_contents($file);
|
||||||
|
$base64 = base64_encode($contents);
|
||||||
|
return ('data:' . $mime . ';base64,' . $base64);
|
||||||
|
}
|
||||||
|
|
||||||
$width = mres($_GET['width']);
|
$width = mres($_GET['width']);
|
||||||
$height = mres($_GET['height']);
|
$height = mres($_GET['height']);
|
||||||
$title = mres($_GET['title']);
|
$title = mres($_GET['title']);
|
||||||
@@ -121,6 +128,7 @@ if ($error_msg) {
|
|||||||
$fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd);
|
$fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd);
|
||||||
} else {
|
} else {
|
||||||
echo(`ls -l $graphfile`);
|
echo(`ls -l $graphfile`);
|
||||||
|
echo('<img src="'.data_uri($graphfile,'image/png').'" alt="graph" />');
|
||||||
}
|
}
|
||||||
unlink($graphfile);
|
unlink($graphfile);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user