tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Added Feature to Display Disk Space Usage

Open hppanpaliya opened this issue 2 years ago • 5 comments

Screenshot 2023-10-17 at 7 29 49 PM Screenshot 2023-10-17 at 7 30 19 PM

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.
  • Introduced a new checkbox under the settings section (js-show-usage) to allow users to toggle the display of disk space usage.
  • Implemented a check for the show_disk_usage setting before executing disk space calculation and display logic.
  • 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.
  • The toggle setting provides flexibility to users to display or hide disk space information based on their preferences or needs.
  • 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.

Screenshots:

Example with Mounted disk: Screenshot 2023-10-17 at 7 30 12 PM

Screenshot 2023-10-17 at 7 29 29 PM

I believe this feature, along with the toggle setting, would be a valuable addition to Tiny File Manager, helping users better manage their disk space on servers with multiple drives. I have tested the changes on my local setup to ensure accuracy and compatibility. Looking forward to the feedback and am happy to make any necessary adjustments.

Thank you for considering this contribution.

hppanpaliya avatar Oct 18 '23 01:10 hppanpaliya

Congratulations

acastrovargas avatar Jan 24 '24 18:01 acastrovargas

This PR reminds me of PR https://github.com/prasathmani/tinyfilemanager/pull/911, albeit this one is more elegant and complete, but I never really understood why the latter wasn't merged back then. I did end up implementing it in my custom version though since I think it's undeniable that it adds to the script without taking anything away.

image

ner00 avatar Jan 24 '24 19:01 ner00

Thank you for referencing PR #911. My PR aims to provide a detailed view of disk usage for systems with multiple mounted drives. Unlike #911, which shows disk space for the root directory, this enhancement displays the disk space for each mounted drive, including external ones. This is particularly useful when drives are mounted as folders, ensuring users can monitor the disk space of these specific directories(drives) accurately. I've attached images from both PRs for clarity, showing the functionality in both the root directory and an external drive context.

Screenshot Screenshot Screenshot Screenshot

hppanpaliya avatar Jan 24 '24 19:01 hppanpaliya

Thanks for clarifying this, I wasn't fully aware of the extension of your implementation (although I admittedly hadn't read your entire description yet). I hope this gets merged soon, but even if it doesn't I'll look into integrating it within my custom script anyway.

ner00 avatar Jan 24 '24 19:01 ner00

will this be merged? it looks good

ririko5834 avatar Jun 25 '24 08:06 ririko5834