mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
stuff (maybe cheesey broke some shit here)
git-svn-id: http://www.observium.org/svn/observer/trunk@2390 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -226,6 +226,28 @@ function generate_graph_tag($args)
|
||||
return '<img src="graph.php?' . implode('&',$urlargs).'" border="0" />';
|
||||
}
|
||||
|
||||
function generate_graph_js_state($args) {
|
||||
// we are going to assume we know roughly what the graph url looks like here.
|
||||
// TODO: Add sensible defaults
|
||||
$from = (is_numeric($args['from']) ? $args['from'] : 0);
|
||||
$to = (is_numeric($args['to']) ? $args['to'] : 0);
|
||||
$width = (is_numeric($args['width']) ? $args['width'] : 0);
|
||||
$height = (is_numeric($args['height']) ? $args['height'] : 0);
|
||||
$legend = str_replace("'", "", $args['legend']);
|
||||
|
||||
$state = <<<STATE
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
document.graphFrom = $from;
|
||||
document.graphTo = $to;
|
||||
document.graphWidth = $width;
|
||||
document.graphHeight = $height;
|
||||
document.graphLegend = '$legend';
|
||||
</script>
|
||||
STATE;
|
||||
|
||||
return $state;
|
||||
}
|
||||
|
||||
function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background)
|
||||
{
|
||||
$output = '
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
if($affected)
|
||||
{
|
||||
$message .= $message_break . $rows . " service deleted!";
|
||||
$message_break .= "<br />"
|
||||
$message_break .= "<br />";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -118,6 +118,8 @@ if (!$auth)
|
||||
$graph_array['to'] = $to;
|
||||
$graph_array['legend'] = "yes";
|
||||
|
||||
echo generate_graph_js_state($graph_array);
|
||||
|
||||
echo("<div style='width:1150px; margin: auto;'>");
|
||||
echo(generate_graph_tag($graph_array));
|
||||
echo("</div>");
|
||||
|
||||
Reference in New Issue
Block a user