mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
restructure $device['os'], improve device overlib a bit (is it?)
git-svn-id: http://www.observium.org/svn/observer/trunk@1464 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -35,20 +35,17 @@ function generatedevicelink($device, $text=0, $start=0, $end=0)
|
||||
$class = devclass($device);
|
||||
if (!$text) { $text = $device['hostname']; }
|
||||
|
||||
if (isset($config['os'][$device['os']]['overgraph']))
|
||||
if (isset($config['os'][$device['os']]['over']))
|
||||
{
|
||||
$graphs = $config['os'][$device['os']]['overgraph'];
|
||||
$descr = $config['os'][$device['os']]['overtext'];
|
||||
$graphs = $config['os'][$device['os']]['over'];
|
||||
}
|
||||
elseif (isset($config['os'][$device['os_group']]['overgraph']))
|
||||
elseif (isset($config['os'][$device['os_group']]['over']))
|
||||
{
|
||||
$graphs = $config['os'][$device['os_group']]['overgraph'];
|
||||
$descr = $config['os'][$device['os_group']]['overtext'];
|
||||
$graphs = $config['os'][$device['os_group']]['over'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$graphs = $config['os']['default']['overgraph'];
|
||||
$descr = $config['os']['default']['overtext'];
|
||||
$graphs = $config['os']['default']['over'];
|
||||
}
|
||||
|
||||
$url = $config['base_url']."/device/" . $device['device_id'] . "/";
|
||||
@@ -63,9 +60,15 @@ function generatedevicelink($device, $text=0, $start=0, $end=0)
|
||||
|
||||
|
||||
if (isset($device['location'])) { $contents .= "" . htmlentities($device['location'])."<br />"; }
|
||||
foreach ($graphs as $graph)
|
||||
foreach ($graphs as $entry)
|
||||
{
|
||||
$contents .= '<img src="' . $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=400&height=120&type=$graph" . '"><br />';
|
||||
$graph = $entry['graph'];
|
||||
$graphhead = $entry['text'];
|
||||
$contents .= '<div style="width: 708px">';
|
||||
$contents .= '<span style="margin-left: 5px; font-size: 12px; font-weight: bold;">'.$graphhead.'</span><br />';
|
||||
$contents .= '<img src="' . $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= '<img src="' . $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=".$config['week']."&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= '</div>';
|
||||
}
|
||||
$text = htmlentities($text);
|
||||
$link = overlib_link($url, $text, $contents, $class);
|
||||
|
||||
Reference in New Issue
Block a user