From d5337a08a8806ce0bb958e1acf906494bd4b0f19 Mon Sep 17 00:00:00 2001 From: bhaal2 Date: Thu, 15 Sep 2016 19:41:16 +1000 Subject: [PATCH] Modify getDiskPercent() to report disk space for all storage areas. --- web/includes/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index b81428b4a..6a8bfc891 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -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() {