Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Feature to Display Disk Space Usage #1100

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hppanpaliya
Copy link

@hppanpaliya hppanpaliya commented Oct 18, 2023

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.

 # 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.
This commit builds upon the previous feature of displaying disk space information by adding a toggle option in the settings to show or hide disk space usage details.

 #### Changes:
- Added a new setting under the settings section allowing users to toggle the display of disk space usage information.
- Updated the disk space display logic to check the setting before fetching and displaying disk space information.

 #### Code Additions:
- Introduced a new checkbox under the settings section 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.

 #### Benefits:
- Provides users with the flexibility to choose whether or not to display disk space information based on their preferences or needs.
- Helps in reducing unnecessary disk space calculations when the information is not needed, potentially improving performance.
- Maintains a clean and uncluttered UI by allowing users to hide disk space information when it's not required.
This commit add translations for the terms 'Used Space' and 'Remaining Space' across all supported languages using Google Translate.
Copy link

@grahn195 grahn195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved code

Copy link

@explorerfaketimepass explorerfaketimepass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@acastrovargas
Copy link

Congratulations

@ner00
Copy link
Contributor

ner00 commented Jan 24, 2024

This PR reminds me of PR #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

@hppanpaliya
Copy link
Author

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

@ner00
Copy link
Contributor

ner00 commented Jan 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants