mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
per device type hover graphs
git-svn-id: http://www.observium.org/svn/observer/trunk@1263 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -217,33 +217,6 @@ function geteventicon ($message)
|
||||
if (isset($icon)) { return $icon; } else { return false; }
|
||||
}
|
||||
|
||||
function generatedevicelink($device, $text=0, $start=0, $end=0)
|
||||
{
|
||||
global $twoday; global $day; global $now; global $config;
|
||||
if (!$start) { $start = $day; }
|
||||
if (!$end) { $end = $now; }
|
||||
$class = devclass($device);
|
||||
if (!$text) { $text = $device['hostname']; }
|
||||
$graph_url = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=400&height=120&type=device_cpu";
|
||||
$graph_url_b = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=400&height=120&type=device_memory";
|
||||
|
||||
$url = $config['base_url']."/device/" . $device['device_id'] . "/";
|
||||
$contents = "<div class=list-large>".$device['hostname']." - CPU & Memory Usage</div>";
|
||||
if (isset($device['location'])) { $contents .= "" . htmlentities($device['location']."<br />"); }
|
||||
$contents .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_b\'";
|
||||
$text = htmlentities($text);
|
||||
$link = overlib_link($url, $text, $contents, $class);
|
||||
if(devicepermitted($device['device_id'])) {
|
||||
return $link;
|
||||
} else {
|
||||
return $device['hostname'];
|
||||
}
|
||||
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
||||
function device_traffic_image($device, $width, $height, $from, $to)
|
||||
{
|
||||
return "<img src='graph.php?device=" . $device . "&type=device_bits&from=" . $from . "&to=" . $to . "&width=" . $width . "&height=" . $height . "&legend=no' />";
|
||||
|
||||
Reference in New Issue
Block a user