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

@@ -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);