change styles a bit. put graphs on device header

git-svn-id: http://www.observium.org/svn/observer/trunk@2497 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-19 02:20:16 +00:00
parent 5c09909be8
commit 58034ce162
5 changed files with 102 additions and 25 deletions

View File

@@ -576,7 +576,7 @@ a:active { color: #00f; }
.vspace { margin-top: 4px; margin-bottom: 4px; }
p.vspace { padding-top: 3px; padding-bottom: 3px; }
.content-mat { padding: 0px; margin: auto; }
.content-mat { padding: 0px; margin: auto; display:block; }
.clearer { clear: both; display: block; padding: 0px; height: 0px; line-height: 1px; font-size: 0px; }
@@ -712,10 +712,9 @@ a.interface-upup:hover, a.interface-updown:hover, a.interface-admindown:hover {
color: #aaaaaa;
}
#center {
#container {
width:1200px;
margin:0px auto 0px auto;
margin:0 auto;
}
#logo {
@@ -1238,3 +1237,22 @@ a.interface-upup:hover, a.interface-updown:hover, a.interface-admindown:hover {
display: none; /* keeps the popup hidden if no JS available */
}
.div-normal {
}
.div-alert {
border: 2px solid;
#border-radius: 10px;
border-color: #cc0000;
}
.div-ignore {
}
.div-ignore-alert {
}
.div-disabled {
}

View File

@@ -1,25 +1,19 @@
<?php
if ($device['status'] == '0')
{
$class = "list-device-down";
} else {
$class = "list-device";
}
if ($device['status'] == '0') { $class = "div-alert"; } else { $class = "div-normal"; }
if ($device['ignore'] == '1')
{
$class = "list-device-ignored";
$class = "div-ignore-alert";
if ($device['status'] == '1')
{
$class = "list-device-ignored-up";
$class = "div-ignore";
}
}
if ($device['disabled'] == '1')
{
$class = "list-device-disabled";
$class = "div-disabled";
}
$type = strtolower($device['os']);
unset($image);
@@ -27,10 +21,53 @@ $image = getImage($device['device_id']);
echo('
<tr bgcolor="'.$device_colour.'" class="'.$class.'">
<td width="40" align=center valign=middle>'.$image.'</td>
<td valign=middle><span style="font-size: 20px;">' . generate_device_link($device) . '</span>
<td width="40" align=center valign=middle style="padding: 21px;">'.$image.'</td>
<td valign=middle style="padding: 0 15px;"><span style="font-size: 20px;">' . generate_device_link($device) . '</span>
<br />' . $device['location'] . '</td>
<td></td>
<td>');
if (isset($config['os'][$device['os']]['over']))
{
$graphs = $config['os'][$device['os']]['over'];
}
elseif (isset($device['os_group']) && isset($config['os'][$device['os_group']]['over']))
{
$graphs = $config['os'][$device['os_group']]['over'];
}
else
{
$graphs = $config['os']['default']['over'];
}
$graph_array['height'] = "100";
$graph_array['width'] = "310";
$graph_array['to'] = $now;
$graph_array['id'] = $device['device_id'];
$graph_array['type'] = "device_bits";
$graph_array['from'] = $day;
$graph_array['legend'] = "no";
$graph_array['popup_title'] = $descr;
# $graph_array['link'] = generate_device_link($device_id);
# print_graph_popup($graph_array);
$graph_array['height'] = "45";
$graph_array['width'] = "150";
$graph_array['bg'] = "FFFFFF00";
foreach ($graphs as $entry)
{
$graph_array['type'] = $entry['graph'];
$graphhead = $entry['text'];
echo("<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; background: #f5f5f5;' class='rounded-5px'>");
print_graph_popup($graph_array);
echo("<div style='font-weight: bold; font-size: 7pt; margin: -3px;'>".$entry['text']."</div>");
echo("</div>");
}
unset($graph_array);
echo('</td>
</tr>');
?>

View File

@@ -227,7 +227,7 @@ function popUp(URL)
// End -->
</script>
<script type="text/javascript" src="js/overlib.js"></script>
<div id="center">
<div id="container">
<?php
@@ -241,9 +241,8 @@ if(!$vars['bare'] == "yes") {
?>
<div class="clearer"></div>
<div class="content-mat" style="border: 1px none #fcc;">
<div id="content" style="border: 1px none #ccc; min-height:650px;">
<div style="margin: 7px;"></div>
<div id="content" style="min-height:650px; width:auto; display:block;">
<div style="clear:both; height:6px; display:block;"></div>
<?php
### To help debug the new URLs :)
@@ -280,7 +279,6 @@ if ($_SESSION['authenticated'])
</div>
<div class="clearer"></div>
</div>
</div>
<?php
$end = utime(); $run = $end - $start;
$gentime = substr($run, 0, 5);

View File

@@ -24,7 +24,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
if ($config['os'][$device['os']]['group']) { $device['os_group'] = $config['os'][$device['os']]['group']; }
echo('<table style="margin: 0px 7px 7px 7px;" cellpadding="15" cellspacing="0" class="devicetable" width="99%">');
echo('<table style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">');
#include("includes/hostbox.inc.php");
include("includes/device-header.inc.php");
echo('</table>');

View File

@@ -49,9 +49,33 @@ if ($_POST['editing'])
$descr = $device['purpose'];
function foldersize($path) {
$total_size = 0;
$files = scandir($path);
$total_files = 0;
foreach($files as $t) {
if (is_dir(rtrim($path, '/') . '/' . $t)) {
if ($t<>"." && $t<>"..") {
$size = foldersize(rtrim($path, '/') . '/' . $t);
$total_size += $size;
}
} else {
$size = filesize(rtrim($path, '/') . '/' . $t);
$total_size += $size;
$total_files++;
}
}
return array($total_size, $total_files);
}
$override_sysLocation_bool = get_dev_attrib($device,'override_sysLocation_bool');
$override_sysLocation_string = get_dev_attrib($device,'override_sysLocation_string');
list($sizeondisk, $numrrds) = foldersize($config['rrd_dir']."/".$device['hostname']);
echo("<b>Size on Disk:" . formatStorage($sizeondisk) . " in " . $numrrds . " RRD files.</b>");
if ($updated && $update_message)
{
print_message($update_message);