mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
better graph browser and fixed collectd graphtype to allow showing of legend
git-svn-id: http://www.observium.org/svn/observer/trunk@2571 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -204,7 +204,7 @@ if(isset($rrd_cmd))
|
|||||||
$rrd_cmd .= " -s " . $from . " -e " . $to;
|
$rrd_cmd .= " -s " . $from . " -e " . $to;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['legend'] == "no" || $_GET['legend'] == 0) { $rrd_cmd .= " -g "; }
|
if ($_GET['legend'] == "no") { $rrd_cmd .= " -g "; }
|
||||||
|
|
||||||
if ($height < "99") { $rrd_cmd .= " --only-graph "; }
|
if ($height < "99") { $rrd_cmd .= " --only-graph "; }
|
||||||
if ($width <= "300") { $rrd_cmd .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'] . " "; }
|
if ($width <= "300") { $rrd_cmd .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'] . " "; }
|
||||||
|
|||||||
@@ -36,18 +36,20 @@ if (!$auth)
|
|||||||
$graph_array = $vars;
|
$graph_array = $vars;
|
||||||
$graph_array['height'] = "60";
|
$graph_array['height'] = "60";
|
||||||
$graph_array['width'] = $thumb_width;
|
$graph_array['width'] = $thumb_width;
|
||||||
$graph_array['legend'] = 0;
|
$graph_array['legend'] = "no";
|
||||||
$graph_array['to'] = $now;
|
$graph_array['to'] = $now;
|
||||||
|
|
||||||
print_optionbar_start();
|
print_optionbar_start();
|
||||||
echo($title);
|
echo($title);
|
||||||
print_optionbar_end();
|
print_optionbar_end();
|
||||||
|
|
||||||
echo('<div style="margin: auto;">');
|
print_optionbar_start();
|
||||||
|
|
||||||
$thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks',
|
$thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks',
|
||||||
'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years');
|
'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years');
|
||||||
|
|
||||||
|
echo('<table width=100%><tr>');
|
||||||
|
|
||||||
foreach ($thumb_array as $period => $text)
|
foreach ($thumb_array as $period => $text)
|
||||||
{
|
{
|
||||||
$graph_array['from'] = $config['time'][$period];
|
$graph_array['from'] = $config['time'][$period];
|
||||||
@@ -58,20 +60,33 @@ if (!$auth)
|
|||||||
$link_array['page'] = "graphs";
|
$link_array['page'] = "graphs";
|
||||||
$link = generate_url($link_array);
|
$link = generate_url($link_array);
|
||||||
|
|
||||||
echo('<div style="margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5; float: left;" class="rounded-3px">
|
echo('<td align=center>');
|
||||||
<span class="device-head">'.$text.'</span><br />
|
echo('<span class="device-head">'.$text.'</span><br />');
|
||||||
<a href="'.$link.'">');
|
echo('<a href="'.$link.'">');
|
||||||
echo(generate_graph_tag($graph_array));
|
echo(generate_graph_tag($graph_array));
|
||||||
echo(" </a>
|
echo('</a>');
|
||||||
</div>");
|
echo('</td>');
|
||||||
|
|
||||||
}
|
}
|
||||||
echo("</div>");
|
|
||||||
|
echo('</tr></table>');
|
||||||
|
|
||||||
$graph_array = $vars;
|
$graph_array = $vars;
|
||||||
|
|
||||||
$graph_array['height'] = "300";
|
$graph_array['height'] = "300";
|
||||||
$graph_array['width'] = $graph_width;
|
$graph_array['width'] = $graph_width;
|
||||||
|
|
||||||
|
echo("<hr />");
|
||||||
|
|
||||||
|
if($vars['legend'] == "no")
|
||||||
|
{
|
||||||
|
echo(generate_link("Show Legend",$vars, array('page' => "graphs", 'legend' => NULL)));
|
||||||
|
} else {
|
||||||
|
echo(generate_link("Hide Legend",$vars, array('page' => "graphs", 'legend' => "no")));
|
||||||
|
}
|
||||||
|
|
||||||
|
print_optionbar_end();
|
||||||
|
|
||||||
|
|
||||||
echo generate_graph_js_state($graph_array);
|
echo generate_graph_js_state($graph_array);
|
||||||
|
|
||||||
echo('<div style="width: '.$graph_array['width'].'; margin: auto;">');
|
echo('<div style="width: '.$graph_array['width'].'; margin: auto;">');
|
||||||
|
|||||||
Reference in New Issue
Block a user