-
Notifications
You must be signed in to change notification settings - Fork 8.6k
添加多任务上传功能 index-multi.html #258
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: main
Are you sure you want to change the base?
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 PR adds a multi-file upload feature to the Telegraph-Image application by introducing index-multi.html and implementing a new cookie-based authentication system to replace basic HTTP authentication.
- Implements concurrent multi-file upload functionality with a modern UI
- Replaces basic HTTP authentication with cookie-based authentication using a dedicated login page
- Adds support for uploading up to 100 files simultaneously with progress tracking
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| index-multi.html | New multi-file upload interface with drag-and-drop support and progress tracking |
| login.html | New dedicated login page with password authentication |
| index.html | Added double-click navigation to admin page |
| functions/upload.js | Modified to handle multiple file uploads concurrently |
| functions/api/manage/auth.js | New authentication endpoint for password-based login |
| functions/api/manage/login.js | Updated to redirect to new login page |
| functions/api/manage/logout.js | Updated to clear authentication cookie |
| functions/api/manage/check.js | Updated to support cookie-based authentication |
| functions/api/manage/_middleware.js | Enhanced to support both cookie and basic authentication |
| admin.html | Updated to redirect to new login page when unauthenticated |
| .vscode/settings.json | Empty VS Code settings file |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // 固定密码 | ||
| const ADMIN_PASSWORD = 'Sangok#3'; |
Copilot
AI
Oct 22, 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.
Hardcoded password in source code is a critical security vulnerability. The password should be stored in an environment variable (e.g., env.ADMIN_PASSWORD) instead of being committed to the repository.
| // 固定密码 | |
| const ADMIN_PASSWORD = 'Sangok#3'; | |
| // 从环境变量读取管理员密码 | |
| const ADMIN_PASSWORD = env.ADMIN_PASSWORD; |
| } | ||
|
|
||
| showCopySuccess() { | ||
| const btn = event.target; |
Copilot
AI
Oct 22, 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.
Direct access to the global event object is deprecated and unreliable across browsers. The event parameter should be explicitly passed to showCopySuccess() from the calling function.
| } | ||
|
|
||
| showCopyError() { | ||
| const btn = event.target; |
Copilot
AI
Oct 22, 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.
Direct access to the global event object is deprecated and unreliable across browsers. The event parameter should be explicitly passed to showCopyError() from the calling function.
| textArea.select(); | ||
|
|
||
| // 尝试使用 execCommand | ||
| const successful = document.execCommand('copy'); |
Copilot
AI
Oct 22, 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 document.execCommand('copy') method is deprecated. While the fallback pattern is acceptable for older browsers, consider adding a user notification when the modern Clipboard API is unavailable rather than silently falling back.
| { | ||
| } No newline at end of file |
Copilot
AI
Oct 22, 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.
Empty configuration file should not be committed to the repository. Either remove this file or add it to .gitignore if it's intended for local development only.
| { | |
| } |
添加多任务上传功能 index-multi.html