mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Modified code to use graph generation functions instead of generating manually.
The graph generation functions check for the status of 'web_mouseover'.
This commit is contained in:
@@ -191,14 +191,25 @@ if($format == "graph") {
|
||||
$width=315;
|
||||
}
|
||||
|
||||
echo("<div style='display: block; padding: 1px; margin: 2px; min-width: ".($width+78)."px; max-width:".($width+78)."px; min-height:170px; max-height:170px; text-align: center; float: left; background-color: #f5f5f5;'>
|
||||
<a href='device/device=".$device['device_id']."/' onmouseover=\"return overlib('\
|
||||
<div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #e5e5e5;\'>".$device['hostname']." - ".$interface['ifDescr']."</div>\
|
||||
<img src=\'graph.php?type=$graph_type&device=".$device['device_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=450&height=150&title=yes\'>\
|
||||
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
|
||||
"<img class='lazy' height='110' width='$width' data-original='graph.php?type=$graph_type&device=".$device['device_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=".$width."&height=110&legend=no&title=yes'>
|
||||
</a>
|
||||
</div>");
|
||||
$graph_array = array();
|
||||
$graph_array['type'] = $graph_type;
|
||||
$graph_array['device'] = $device['device_id'];
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['from'] = $config['time']['day'];
|
||||
$graph_array['height'] = '110';
|
||||
$graph_array['width'] = $width;
|
||||
$graph_array['legend'] = 'no';
|
||||
$graph_array['title'] = 'yes';
|
||||
|
||||
$graph_array_zoom = $graph_array;
|
||||
$graph_array_zoom['height'] = '150';
|
||||
$graph_array_zoom['width'] = '400';
|
||||
$graph_array_zoom['legend'] = 'yes';
|
||||
|
||||
$overlib_link = "device/device=".$device['device_id']."/";
|
||||
echo "<div style='display: block; padding: 1px; margin: 2px; min-width: ".($width+78)."px; max-width:".($width+78)."px; min-height:170px; max-height:170px; text-align: center; float: left; background-color: #f5f5f5;'>";
|
||||
echo overlib_link($overlib_link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
|
||||
echo "</div>\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user