From 49d8e35e56a3d0960b475d074f176de504a039d3 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 11 Nov 2016 07:47:08 -0600 Subject: [PATCH] Show available PATH_MAP percent on console (#1675) * Add PATH_SWAP percent to console * add changes to console.php * use ZM_PATH_MAP instead of ZM_PATH_SWAP * show the folder name PATH_MAP points to * use a dash as the delimiter instead of fwd slash --- web/includes/functions.php | 10 +++++----- web/skins/classic/views/console.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 765026a6d..667cab4de 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1429,15 +1429,15 @@ function getLoad() { return( $load[0] ); } -function getDiskPercent() { - $total = disk_total_space(ZM_DIR_EVENTS); +function getDiskPercent($path = ZM_DIR_EVENTS) { + $total = disk_total_space($path); if ( ! $total ) { - Error("disk_total_space returned false for " . ZM_DIR_EVENTS ); + Error("disk_total_space returned false for " . $path ); return 0; } - $free = disk_free_space(ZM_DIR_EVENTS); + $free = disk_free_space($path); if ( ! $free ) { - Error("disk_free_space returned false for " . ZM_DIR_EVENTS ); + Error("disk_free_space returned false for " . $path ); } $space = round(($total - $free) / $total * 100); return( $space ); diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php index 6e06d9176..22368b619 100644 --- a/web/skins/classic/views/console.php +++ b/web/skins/classic/views/console.php @@ -195,7 +195,7 @@ xhtmlHeaders( __FILE__, translate('Console') );