cyberpanel/plogical
usmannasir 4bedb9cd73 Implement real-time disk usage updates with async background processing
This commit implements an improved version of PRs #1575 and #1576 from @bdgreenweb
with critical performance optimizations.

## Background
The original PRs (#1575, #1576) proposed real-time disk usage tracking for file
manager operations. While the feature was valuable for improving user awareness of
disk quotas, there were several concerns:

1. **Performance Impact**: Original implementation used synchronous `executioner()`
   calls that would block file operations until disk calculation completed
2. **Target Branch Issues**: PRs were submitted to the stable branch instead of
   development branch, which could introduce instability
3. **Blocking Operations**: Each file operation would wait for disk usage
   recalculation, potentially causing noticeable delays

## Implementation Changes

### filemanager/filemanager.py
- Added disk usage updates to 9 file operation methods:
  - createNewFile() - After file creation
  - createNewFolder() - After folder creation
  - deleteFolderOrFile() - After deletion (both permanent and trash)
  - restore() - After restoring from trash
  - copy() - After copying files/folders
  - move() - After moving files/folders
  - upload() - After file uploads
  - extract() - After extracting archives
  - compress() - After creating archives

### plogical/IncScheduler.py
- Added CalculateAndUpdateDiskUsageDomain() function for domain-specific updates
- Added command-line argument handler for UpdateDiskUsageForceDomain
- Calculates disk usage for websites, email accounts, and bandwidth

## Key Improvements Over Original PRs

1. **Asynchronous Execution**: Uses `popenExecutioner()` instead of `executioner()`
   - File operations return immediately without waiting
   - Disk usage updates happen in background threads
   - Zero performance impact on user operations

2. **Selective Updates**: Only updates the specific domain affected by the operation
   rather than all domains system-wide

3. **Proper Branch Targeting**: Applied to development branch (v2.5.5-dev) for
   proper testing before stable release

## Benefits
- Real-time disk usage tracking as requested
- No performance degradation
- Users immediately aware of quota usage
- Prevents accidental quota violations
- Better than competitors (cPanel/DirectAdmin) in responsiveness

## Acknowledgments
Thank you @bdgreenweb for the original implementation idea and PRs #1575/#1576.
While we couldn't merge them directly due to the performance and stability concerns
mentioned above, your contribution highlighted an important feature gap. This
implementation preserves your core functionality while addressing the performance
concerns through asynchronous execution.

This will definitely help organizations track disk usage more effectively without
sacrificing file manager performance.
2025-10-08 13:40:16 +05:00
..
management Add subdomain log fix functionality and update templates. Introduce new views and URLs for fixing subdomain logs, enhance log configuration handling in the upgrade script, and update vHost configuration paths for better log management. Include a new menu item for accessing the log fix interface. 2025-09-18 22:04:05 +02:00
.my.cnf.4370 Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
.mysql.4370 Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
Backupsv2.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
ClusterManager.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
CyberCPLogFileWriter.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
CyberPanelUpgrade.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
DockerSites.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
IncScheduler.py Implement real-time disk usage updates with async background processing 2025-10-08 13:40:16 +05:00
SwitchOldAliasToNew.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
__init__.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
acl.py Update PHP version references and improve AlmaLinux 9 compatibility 2025-09-15 01:25:52 +02:00
acl.py.backup_dns_fix bug fix: https://github.com/usmannasir/cyberpanel/issues/773 2025-08-11 00:33:25 +05:00
adminPass.py v2.4.4 release 2025-09-01 13:11:42 +05:00
alias.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
apiAccess.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
applicationInstaller.py bug fixes to wp installation 2025-08-07 06:58:48 +05:00
backupSchedule.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
backupScheduleLocal.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
backupUtilities.py v2.4.4 release 2025-09-01 13:11:42 +05:00
bandwidthReset.py Enhance CyberPanel functionality with FTP Quota and Bandwidth Management features: Added models, views, and templates for managing FTP quotas and bandwidth resets. Implemented IP blocking functionality with associated views and templates. Updated system scripts for improved repository synchronization and OS detection. Removed outdated workflow files. 2025-09-23 21:09:38 +02:00
cPanelImporter.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
childDomain.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
cronUtil.py Add cron job management for website suspension: Implement methods to suspend, restore, and check the status of cron jobs for websites. Update main function to handle new commands for cron management. Enhance child domain handling to ensure cron jobs are suspended/restored appropriately during website suspension processes. 2025-09-21 20:45:37 +02:00
csf.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
customACME.py bug fix: https://github.com/usmannasir/cyberpanel/issues/1471 2025-08-08 00:56:41 +05:00
dnsUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
domain.xml Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
emergency_2fa_disable.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
errorSanitizer.py Update README and enhance error handling: Increment version to 2.4 Build 4 and add notes on PHP version management. Improve error logging across multiple modules by replacing BaseException with Exception and utilizing secure error handling methods. Ensure consistent error responses in API and middleware functions for better debugging and user feedback. 2025-09-21 20:36:12 +02:00
filesPermsUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
findBWUsage.py Enhance CyberPanel with new features and improvements, including a file integrity verification system, IP blocking functionality, and support for resetting Apache and vHost configurations to default. Update documentation and guides for better user experience. Fix bandwidth reset issues and improve overall system stability. 2025-09-18 20:45:34 +02:00
firewallUtilities.py Enhance CyberPanel functionality with FTP Quota and Bandwidth Management features: Added models, views, and templates for managing FTP quotas and bandwidth resets. Implemented IP blocking functionality with associated views and templates. Updated system scripts for improved repository synchronization and OS detection. Removed outdated workflow files. 2025-09-23 21:09:38 +02:00
ftpUtilities.py Enhance text readability and error handling: Add readability fixes CSS for improved contrast across UI elements. Update text colors in various components for better visibility. Enhance FTP error handling with user-friendly messages and improved path validation in both frontend and backend. Update HTML templates to provide clearer instructions and examples for FTP path input. 2025-09-21 22:26:18 +02:00
getSystemInformation.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
hashPassword.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
httpProc.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
installUtilities.py Enhance CyberPanel with new features and improvements, including a file integrity verification system, IP blocking functionality, and support for resetting Apache and vHost configurations to default. Update documentation and guides for better user experience. Fix bandwidth reset issues and improve overall system stability. 2025-09-18 20:45:34 +02:00
letsEncrypt.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
mailUtilities.py Add sieve by default. 2025-09-10 20:01:52 +02:00
modSec.py Enhance ModSecurity rule installation and verification: Update OWASP rules to version 4.18.0, improving detection for installed rules in the FirewallManager. Add checks to verify the existence of OWASP and Comodo configuration files. Update JavaScript to reflect installation status and improve user feedback. Ensure proper logging for installation processes and errors. 2025-09-22 18:05:55 +02:00
mysqlUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
phpUtilities.py Update PHP version handling and installation logic across scripts 2025-09-24 01:11:23 +02:00
phpmyadminsignin.php Fix phpMyAdmin access issue for authenticated users 2025-10-06 12:27:33 +05:00
pluginManagerGlobal.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
processUtilities.py Enhance CyberPanel with new features and improvements, including a file integrity verification system, IP blocking functionality, and support for resetting Apache and vHost configurations to default. Update documentation and guides for better user experience. Fix bandwidth reset issues and improve overall system stability. 2025-09-18 20:45:34 +02:00
randomPassword.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
rebuildQuotas.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
remoteBackup.py Implement remote connection handling and progress tracking for backup operations: Introduce a method for attempting connections to remote CyberPanel servers with port fallback. Enhance the frontend to display detailed progress and logs during backup transfers, including error handling and notifications for port fallback usage. Update HTML and JavaScript to support new progress tracking features and improve user feedback during backup and restore processes. 2025-09-20 21:31:41 +02:00
remoteTransferUtilities.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
renew.py Enhance SSL renewal process: Add method to update mail SSL configurations for all domains after renewal. Update mail SSL settings in the Renew class and ensure vhost SSL configurations are updated accordingly. Remove obsolete screenshot file. 2025-09-21 19:46:10 +02:00
restoreMeta.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
serverLogs.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
sslReconcile.py Remove SECURITY_INSTALLATION.md and implement SSL reconciliation features in manageSSL module. Add new views and URLs for SSL reconciliation, enhance mobile responsiveness in templates, and update SSL utilities for improved functionality. Update upgrade script for scheduled SSL reconciliation tasks. 2025-09-18 21:37:48 +02:00
sslUtilities.py Remove SECURITY_INSTALLATION.md and implement SSL reconciliation features in manageSSL module. Add new views and URLs for SSL reconciliation, enhance mobile responsiveness in templates, and update SSL utilities for improved functionality. Update upgrade script for scheduled SSL reconciliation tasks. 2025-09-18 21:37:48 +02:00
sslv2.py bug fix: https://github.com/usmannasir/cyberpanel/issues/1471 2025-08-08 00:56:41 +05:00
test.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
test1.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
tuning.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
upgrade.py fix static file permissions 2025-10-01 11:46:58 +05:00
upgradeCritical.py Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00
versionFetcher.py Enhance CyberPanel with new features and improvements, including a file integrity verification system, IP blocking functionality, and support for resetting Apache and vHost configurations to default. Update documentation and guides for better user experience. Fix bandwidth reset issues and improve overall system stability. 2025-09-18 20:45:34 +02:00
vhost.py Merge pull request #1510 from master3395/v2.5.5-dev 2025-09-23 12:29:21 +05:00
vhostConfs.py Fix ACME challenge path to use centralized Example directory 2025-10-03 15:50:29 +05:00
virtualHostUtilities.py Merge pull request #1510 from master3395/v2.5.5-dev 2025-09-23 12:29:21 +05:00