mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
cleaup some graph drawing functions and interface text printing functions (much moar needed)
git-svn-id: http://www.observium.org/svn/observer/trunk@1086 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -224,39 +224,6 @@ function geteventicon ($message)
|
||||
if (isset($icon)) { return $icon; } else { return false; }
|
||||
}
|
||||
|
||||
function generateiflink($interface, $text=0, $type = NULL)
|
||||
{
|
||||
global $twoday; global $now; global $config; global $day; global $month;
|
||||
$interface = ifNameDescr($interface);
|
||||
if (!$text) { $text = fixIfName($interface['label']); }
|
||||
if (isset($type)) { $interface['graph_type'] = $type; } else { $interface['graph_type'] = 'port_bits'; }
|
||||
if(!isset($interface['hostname'])) { $interface = array_merge($interface, device_by_id_cache($interface['device_id'])); }
|
||||
$class = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']);
|
||||
$graph_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from=$day&to=$now&width=400&height=100&type=" . $interface['graph_type'];
|
||||
$graph_url_month = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from=$month&to=$now&width=400&height=100&type=" . $interface['graph_type'];
|
||||
$device_id = getifhost($interface['interface_id']);
|
||||
$url = $config['base_url']."/device/$device_id/interface/" . $interface['interface_id'] . "/";
|
||||
|
||||
$contents = "<div class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['label']) . "</div>";
|
||||
if ($interface['ifAlias']) { $contents .= htmlentities($interface['ifAlias'] ."<br />" ); }
|
||||
$contents .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_month\'>";
|
||||
$link = overlib_link($url, $text, $contents, $class);
|
||||
if(interfacepermitted($interface['interface_id'])) {
|
||||
return $link;
|
||||
} else {
|
||||
return fixifName($interface['label']);
|
||||
}
|
||||
}
|
||||
|
||||
function overlib_link($url, $text, $contents, $class) {
|
||||
global $config;
|
||||
$contents = str_replace("\"", "\'", $contents);
|
||||
$output = "<a class='".$class."' href='".$url."'";
|
||||
$output .= " onmouseover=\"return overlib('".$contents."'".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">";
|
||||
$output .= $text."</a>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
function generatedevicelink($device, $text=0, $start=0, $end=0)
|
||||
{
|
||||
global $twoday; global $day; global $now; global $config;
|
||||
|
||||
Reference in New Issue
Block a user