-
Notifications
You must be signed in to change notification settings - Fork 2
new ui #201
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
base: master
Are you sure you want to change the base?
new ui #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a major UI overhaul for the docker-uploader application, updating it to the latest dockserver release (version 5.0.0). The changes include a complete redesign of the web interface with a modern, responsive layout featuring multiple theme options, improved API endpoints for better data management, and enhanced backend functionality.
Key Changes
- Complete UI redesign with modern, responsive interface featuring sidebar navigation and 17 theme options
- New API endpoints for version checking, environment settings management, and queue statistics
- Database schema enhancements including new columns for better data tracking (filesize_bytes, time_end_clean, successful)
- Improved error handling and database operations with busy timeout support
- Enhanced shell scripts with environment file validation and safer update mechanisms
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| index.html | Complete redesign with sidebar navigation, dashboard cards, and multi-section layout |
| js/app.js | Comprehensive rewrite with modular functions, auto-save, and enhanced state management |
| js/utils.js | New utility file with helper functions for formatting, theme management, and data handling |
| css/styles.css | New stylesheet replacing old style.css with modern CSS variables and theme support |
| srv/api/system/version.php | New endpoint for version checking with fallback mechanisms |
| srv/api/system/update_env.php | New endpoint for updating environment settings with validation |
| srv/api/system/env_settings.php | New endpoint for reading environment settings |
| srv/api/jobs/queue_stats.php | New endpoint for queue statistics |
| srv/api/jobs/queue.php | New endpoint for queue file listing |
| srv/entities/UploadJobStatus.php | Added new properties for enhanced job tracking |
| srv/entities/StatusResponse.php | Added uptime and storage properties |
| init-install/run | Enhanced with environment file validation and database schema updates |
| function-gdsa.sh | Improved with filesize_bytes tracking and safer database operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Find the appropriate section to add the setting | ||
| foreach ($data as $key => $value) { | ||
| // Convert key to uppercase for env file | ||
| $upperKey = strtoupper($key); | ||
|
|
||
| // Check if the value needs quotes | ||
| if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) { | ||
| $formattedValue = $value; | ||
| } else { | ||
| if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) { | ||
| $formattedValue = $value; | ||
| } else { | ||
| $formattedValue = '"' . $value . '"'; | ||
| } | ||
| } |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code has duplicate logic for formatting values (lines 138-147 and lines 184-192). This duplication makes the code harder to maintain. Consider extracting this into a helper function.
| // Find the appropriate section to add the setting | |
| foreach ($data as $key => $value) { | |
| // Convert key to uppercase for env file | |
| $upperKey = strtoupper($key); | |
| // Check if the value needs quotes | |
| if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) { | |
| $formattedValue = $value; | |
| } else { | |
| if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) { | |
| $formattedValue = $value; | |
| } else { | |
| $formattedValue = '"' . $value . '"'; | |
| } | |
| } | |
| // Helper to consistently format environment values | |
| function formatEnvValue($value) | |
| { | |
| // Check if the value needs quotes | |
| if ($value === 'true' || $value === 'false' || $value === 'null' || is_numeric($value)) { | |
| return $value; | |
| } | |
| if (preg_match('/^".*"$/', $value) || preg_match("/^'.*'$/", $value)) { | |
| return $value; | |
| } | |
| return '"' . $value . '"'; | |
| } | |
| // Find the appropriate section to add the setting | |
| foreach ($data as $key => $value) { | |
| // Convert key to uppercase for env file | |
| $upperKey = strtoupper($key); | |
| $formattedValue = formatEnvValue($value); |
| $status = StatusResponse::STATUS_UNKNOWN; | ||
| $uptime = null; | ||
| $storage = null; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local variables initialized in the constructor are not assigned to the object properties. They should use $this-> to set the actual object properties. Currently, these values are discarded after the constructor completes.
| $status = StatusResponse::STATUS_UNKNOWN; | |
| $uptime = null; | |
| $storage = null; | |
| $this->status = StatusResponse::STATUS_UNKNOWN; | |
| $this->uptime = null; | |
| $this->storage = null; |
|
|
||
| foreach ($lines as $line) { | ||
| // Skip comments and section headers | ||
| if (strpos($line, '#') === 0 || strpos($line, '##') === 0 || strpos($line, '----') === 0) { |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern uses an unescaped hyphen in a character class which could be interpreted as a range. The hyphen at the end of the pattern should be escaped as '-' or moved to the beginning/end of the character class to avoid ambiguity.
| chmod($envFile, 0755); | ||
| chown($envFile, 'abc'); | ||
| chgrp($envFile, 'abc'); | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chmod operations are attempting to change file ownership using chown/chgrp with the 'abc' user, but these operations may fail silently if the script doesn't have appropriate permissions. Consider adding error checking or removing these operations if they're not essential.
| chmod($envFile, 0755); | |
| chown($envFile, 'abc'); | |
| chgrp($envFile, 'abc'); | |
| if (!@chmod($envFile, 0755)) { | |
| error_log("updateEnvFile: Failed to chmod {$envFile} to 0755"); | |
| } | |
| // Change owner and group only when running with sufficient privileges | |
| if (function_exists('posix_getuid') && posix_getuid() === 0) { | |
| if (!@chown($envFile, 'abc')) { | |
| error_log("updateEnvFile: Failed to chown {$envFile} to user 'abc'"); | |
| } | |
| if (!@chgrp($envFile, 'abc')) { | |
| error_log("updateEnvFile: Failed to chgrp {$envFile} to group 'abc'"); | |
| } | |
| } |
| continue; | ||
| } | ||
|
|
||
| // Remove any dangerous characters |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern '/[^A-Za-z0-9_]/' removes all characters except alphanumeric and underscore, but the comment says "Remove any dangerous characters". This is overly broad and will remove legitimate characters like hyphens. Consider being more specific about what constitutes "dangerous" or document why this aggressive filtering is necessary.
| // Remove any dangerous characters | |
| // Normalize key: allow only letters, digits, and underscore to avoid unexpected env key formats |
|
|
||
| switch (timeRange) { | ||
| case "day": | ||
| days = 1; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value assigned to days here is unused.
| days = 1; |
| } | ||
|
|
||
| // Calculate progress bar class based on percentage | ||
| let progressClass = "bg-secondary"; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial value of progressClass is unused, since it is always overwritten.
| let progressClass = "bg-secondary"; | |
| let progressClass; |
[5.3.23.2] - 2025-12-18Fixed
Technical Improvements
|
apprise install fix removed rclone.conf improved functions scripts
updated to latest dockserver release
Description of the change
Benefits
Possible drawbacks
Applicable issues
Additional information