diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 8e0b8f9d9..bce5b5e10 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -511,4 +511,29 @@ function getlocations() return $locations; } +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); +} + ?> diff --git a/html/pages/device/edit/device.inc.php b/html/pages/device/edit/device.inc.php index 2c1a6eabb..b77141916 100644 --- a/html/pages/device/edit/device.inc.php +++ b/html/pages/device/edit/device.inc.php @@ -49,32 +49,9 @@ 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("Size on Disk:" . formatStorage($sizeondisk) . " in " . $numrrds . " RRD files."); - if ($updated && $update_message) { @@ -91,23 +68,22 @@ if ($updated && $update_message)
- +
- -
- - - - - - - - - + + + + + + + + + + + + +
Description:
- Type: - - + + + + + + + + - - - - - - - - - - - - -
Description:
+ Type: + + -
/>
Override sysLocation: value="" />
Disable
/>
Ignore
/>
- - - + +
/>
Override sysLocation: value="" />
Disable
/>
Ignore
/> 
+ + + + + + +
- - +" . formatStorage($sizeondisk) . " in " . $numrrds . " RRD files."); + +print_optionbar_end(); + +?>