From 40ebbcbbb33a6145778602402c4e7a6a07570165 Mon Sep 17 00:00:00 2001 From: hppanpaliya Date: Tue, 17 Oct 2023 21:49:07 -0400 Subject: [PATCH] Added Feature to Display Disk Space Usage # Changes: - Added disk space calculation logic to the `index.php` file. - Updated the file listing footer to include total, used, and remaining disk space information. - Utilized `disk_total_space`, `disk_free_space`, and `fm_get_filesize` functions to obtain and format disk space information. - Ensured that the feature works seamlessly with existing functionalities and adheres to the project's coding standards. # Benefits: - Users with multiple mounted drives on their servers can easily see how much disk space is available, used, and remaining on each drive, facilitating better disk space management. - Enhances user experience by providing valuable disk space information, aiding in capacity planning and preventing potential issues related to disk space exhaustion. - Helps in monitoring disk space usage directly from the file manager without needing to use external tools or commands. # Use Case: - As someone managing a server with multiple mounted drives, this feature is invaluable for monitoring the disk space usage on each drive. It helps in ensuring that none of the drives are nearing capacity, which could lead to performance degradation or even system failures. Having this information readily available within Tiny File Manager streamlines the process of managing disk space and ensures that I can take timely action if needed, such as cleaning up old files or moving data to other drives with more available space. --- tinyfilemanager.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index ca73f9d..e1e7a0f 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -2202,10 +2202,25 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white + + + + '.fm_get_filesize($all_files_size).'' ?> + ' .$total_used_size.''; ?> + ' .$free_size.''; ?> '.$num_files.'' ?> '.$num_folders.'' ?> @@ -4287,6 +4302,8 @@ function lng($txt) { $tr['en']['Invalid characters in file or folder name'] = 'Invalid characters in file or folder name'; $tr['en']['Operations with archives are not available'] = 'Operations with archives are not available'; $tr['en']['File or folder with this path already exists'] = 'File or folder with this path already exists'; + $tr['en']['RemainingSpace'] = 'Remaining Space'; + $tr['en']['UsedSpace'] = 'Used Space'; $i18n = fm_get_translations($tr); $tr = $i18n ? $i18n : $tr;