Continue moving styles to CSS

- Also started standardised infrastructure for minigraphs to make it easy to create them anywhere
This commit is contained in:
Paul Gear
2013-11-10 14:08:02 +10:00
parent e953543c88
commit 6e9623c96d
3 changed files with 39 additions and 7 deletions
+27 -1
View File
@@ -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;
}
+10 -4
View File
@@ -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'].
"&amp;from=$start&amp;to=$end&amp;width=$width&amp;height=$height&amp;type=$type&amp;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'] . "&amp;from=$start&amp;to=$end&amp;width=275&amp;height=100&amp;type=$graph&amp;legend=no" . '" style="margin: 2px;">';
$contents .= "<img src=\"graph.php?device=" . $device['device_id'] . "&amp;from=".$config['time']['week']."&amp;to=$end&amp;width=275&amp;height=100&amp;type=$graph&amp;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>';
}
+2 -2
View File
@@ -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>");
}