mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Continue moving styles to CSS
- Also started standardised infrastructure for minigraphs to make it easy to create them anywhere
This commit is contained in:
@@ -108,6 +108,12 @@ function get_percentage_colours($percentage)
|
||||
|
||||
}
|
||||
|
||||
function generate_minigraph_image($device, $start, $end, $type, $legend = 'no', $width = 275, $height = 100)
|
||||
{
|
||||
return '<img class=minigraph-image src="graph.php?device='.$device['device_id'].
|
||||
"&from=$start&to=$end&width=$width&height=$height&type=$type&legend=$legend".'">';
|
||||
}
|
||||
|
||||
function generate_device_url($device, $vars=array())
|
||||
{
|
||||
return generate_url(array('page' => 'device', 'device' => $device['device_id']), $vars);
|
||||
@@ -151,10 +157,10 @@ function generate_device_link($device, $text=NULL, $vars=array(), $start=0, $end
|
||||
{
|
||||
$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=\"graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= "<img src=\"graph.php?device=" . $device['device_id'] . "&from=".$config['time']['week']."&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= '<div class=overlib-box>';
|
||||
$contents .= '<span class=overlib-title>'.$graphhead.'</span><br />';
|
||||
$contents .= generate_minigraph_image($device, $start, $end, $graph);
|
||||
$contents .= generate_minigraph_image($device, $config['time']['week'], $end, $graph);
|
||||
$contents .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user