mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +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:
+27
-1
@@ -467,6 +467,18 @@ a.list-device-disabled, a.list-device-disabled:visited {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.front-page {
|
||||
padding: 3px 10px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.front-page-bgp-normal {
|
||||
}
|
||||
|
||||
.front-page-bgp-small {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.front-box {
|
||||
text-align: center;
|
||||
margin: 1pt;
|
||||
@@ -1476,7 +1488,6 @@ tr.search:nth-child(odd) {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
.paddedcell {
|
||||
padding: 7px;
|
||||
}
|
||||
@@ -1489,3 +1500,18 @@ tr.search:nth-child(odd) {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.overlib-box {
|
||||
width: 708px;
|
||||
}
|
||||
|
||||
.overlib-title {
|
||||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.minigraph-image {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ echo("<div class=\"front-box $frontbox_class\">
|
||||
</div>");
|
||||
}
|
||||
|
||||
echo("<div style='padding: 3px 10px; background: #fff;'>");
|
||||
echo("<div class=front-page>");
|
||||
|
||||
if ($_SESSION['userlevel'] == '10')
|
||||
{
|
||||
@@ -73,7 +73,7 @@ if (isset($config['enable_bgp']) && $config['enable_bgp'])
|
||||
{
|
||||
generate_front_box("bgp-down", "<center>".generate_device_link($peer, shorthost($peer['hostname']))."<br />
|
||||
<span class=bgp-down>BGP Down</span>
|
||||
<span style='" . (strstr($peer['bgpPeerIdentifier'],':') ? 'font-size: 10px' : '') . "'>".$peer['bgpPeerIdentifier']."</span><br />
|
||||
<span class='" . (strstr($peer['bgpPeerIdentifier'],':') ? 'front-page-bgp-small' : 'front-page-bgp-normal') . "'>".$peer['bgpPeerIdentifier']."</span><br />
|
||||
<span class=body-date-1>AS".truncate($peer['bgpPeerRemoteAs']." ".$peer['astext'], 14, "")."</span>
|
||||
</center>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user