Modify getDiskPercent() to report disk space for all storage areas.

This commit is contained in:
bhaal2 2016-09-15 19:41:16 +10:00
parent 01ae4de123
commit d5337a08a8
1 changed files with 9 additions and 1 deletions

View File

@ -1471,7 +1471,15 @@ function getDiskPercent() {
Error("disk_free_space returned false for " . ZM_DIR_EVENTS );
}
$space = round(($total - $free) / $total * 100);
return( $space );
$spaceString = 'Default '.$space.'%';
$storageAreas = dbFetchAll("select path, name from Storage order by Id");
foreach($storageAreas as $storagePath) {
$storageTotal = disk_total_space($storagePath['path']);
$storageFree = disk_free_space($storagePath['path']);
$storageSpace = round(($storageTotal - $storageFree) / $storageTotal * 100);
$spaceString .= ', '.$storagePath['name'].' '.$storageSpace;
}
return( $spaceString );
}
function getDiskBlocks() {