Files
librenms-librenms/html/pages/device/graphs.inc.php
T

64 lines
1.5 KiB
PHP
Raw Normal View History

2009-09-07 11:07:59 +00:00
<?php
2007-04-04 10:15:07 +00:00
### Sections are printed in the order they exist in $config['graph_sections']
2010-07-31 00:54:51 +00:00
### Graphs are printed in the order they exist in $config['graph_types']
2011-09-18 13:11:04 +00:00
$link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'graphs');
$bg="#ffffff";
2010-01-08 00:01:26 +00:00
echo('<div style="clear: both;">');
2010-01-08 00:01:26 +00:00
print_optionbar_start();
2010-01-08 00:01:26 +00:00
echo("<span style='font-weight: bold;'>Graphs</span> &#187; ");
$sep = "";
2011-03-16 23:10:10 +00:00
2011-05-15 15:29:47 +00:00
foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ?", array($device['device_id'])) as $graph)
{
$section = $config['graph_types']['device'][$graph['graph']]['section'];
$graph_enable[$section][$graph['graph']] = $graph['graph'];
2010-07-31 00:54:51 +00:00
}
foreach ($config['graph_sections'] as $section)
2010-07-31 00:54:51 +00:00
{
if (isset($graph_enable) && is_array($graph_enable[$section]))
{
$type = strtolower($section);
if (!$vars['group']) { $vars['group'] = $type; }
2010-07-31 00:54:51 +00:00
echo($sep);
if ($vars['group'] == $type)
2010-07-31 00:54:51 +00:00
{
echo('<span class="pagemenu-selected">');
2010-07-31 00:54:51 +00:00
}
2011-03-16 23:10:10 +00:00
echo(generate_link(ucfirst($type),$link_array,array('group'=>$type)));
2011-09-20 09:55:11 +00:00
if ($vars['group'] == $type)
{
echo("</span>");
}
2010-07-31 00:54:51 +00:00
$sep = " | ";
}
2007-04-04 10:15:07 +00:00
}
2011-03-16 23:10:10 +00:00
unset ($sep);
print_optionbar_end();
$graph_enable = $graph_enable[$vars['group']];
2011-03-16 23:10:10 +00:00
foreach ($config['graph_types']['device'] as $graph => $entry)
2010-07-31 00:54:51 +00:00
{
2011-03-16 23:10:10 +00:00
if ($graph_enable[$graph])
2010-07-31 00:54:51 +00:00
{
$graph_title = $config['graph_types']['device'][$graph]['descr'];
$graph_type = "device_" . $graph;
2011-03-17 16:35:18 +00:00
include("includes/print-device-graph.php");
2010-07-31 00:54:51 +00:00
}
}
2007-04-04 10:15:07 +00:00
?>