Add resumable upload feature with progress display

- Implement chunked file upload with 1MB chunk size
- Add progress bar with percentage and chunk counter (e.g., 2/5)
- Support resuming interrupted uploads
- Improve UI with better progress visualization
- Add dropzone.js integration for drag-and-drop uploads
- Fix progress bar jumping issue in resumable uploads
- Add file type icons and size display
- Enhance error handling and user feedback
This commit is contained in:
admin
2026-01-23 15:29:26 +08:00
parent 88db4903c9
commit 6f3cc6b725
6 changed files with 551 additions and 242 deletions

View File

@@ -394,13 +394,17 @@ body {
background: white;
border-radius: 12px;
width: 100%;
max-width: 450px;
max-width: 600px;
max-height: 90vh;
overflow: hidden;
display: flex;
flex-direction: column;
}
.upload-modal .modal-content {
max-width: 650px;
}
.modal-large {
max-width: 900px;
}
@@ -777,3 +781,177 @@ body {
.upload-speed.active {
display: block;
}
.upload-file-list {
margin-top: 15px;
max-height: 250px;
overflow-y: auto;
}
.upload-file-item {
display: flex;
align-items: center;
padding: 8px 10px;
border: 1px solid #eee;
border-radius: 6px;
margin-bottom: 6px;
background: #fafafa;
gap: 10px;
}
.upload-file-item:last-child {
margin-bottom: 0;
}
.upload-file-item .dz-icon {
font-size: 20px;
width: 24px;
text-align: center;
flex-shrink: 0;
}
.upload-file-item .dz-info {
flex: 1;
min-width: 0;
overflow: hidden;
}
.upload-file-item .dz-filename {
font-size: 12px;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 2px;
}
.upload-file-item .dz-size {
font-size: 10px;
color: #999;
}
.upload-file-item .dz-progress-wrap {
width: 100px;
flex-shrink: 0;
display: flex;
align-items: center;
}
.upload-file-item .dz-percent {
font-size: 11px;
color: #666;
margin-left: 6px;
min-width: 36px;
text-align: left;
font-family: monospace;
}
.upload-file-item .dz-chunks {
font-size: 10px;
color: #999;
margin-right: 4px;
}
.upload-file-item .dz-progress {
width: 100%;
height: 6px;
background: #e0e0e0;
border-radius: 3px;
overflow: hidden;
display: block;
margin: 0;
padding: 0;
}
.upload-file-item .dz-upload {
display: block;
height: 100%;
background: #2196f3 !important;
border-radius: 3px;
width: 0%;
transition: width 0.1s linear;
min-width: 0;
}
.upload-file-item .dz-status {
width: 24px;
text-align: center;
font-size: 16px;
flex-shrink: 0;
}
.upload-file-item .dz-success-mark {
color: #4caf50;
display: none;
}
.upload-file-item .dz-error-mark {
color: #f44336;
display: none;
}
.upload-file-item.dz-success .dz-success-mark {
display: inline;
}
.upload-file-item.dz-error .dz-error-mark {
display: inline;
}
.upload-file-item .dz-remove {
color: #999;
font-size: 14px;
cursor: pointer;
padding: 4px 6px;
border-radius: 4px;
flex-shrink: 0;
}
.upload-file-item .dz-remove:hover {
background: #ffebee;
color: #f44336;
}
.upload-file-item .dz-error-message {
color: #f44336;
font-size: 11px;
padding: 4px 8px;
background: #ffebee;
border-radius: 4px;
margin-top: 4px;
display: none;
}
.upload-file-item.dz-error .dz-error-message {
display: block;
}
.upload-file-item.dz-error .dz-filename {
color: #f44336;
}
.dropzone {
border: 2px dashed #e0e0e0 !important;
border-radius: 8px !important;
background: #fafafa !important;
min-height: 100px !important;
padding: 20px !important;
transition: all 0.2s;
}
.dropzone:hover,
.dropzone.dz-drag-hover {
border-color: #2196f3 !important;
background: #f0f7ff !important;
}
.dropzone .dz-message {
text-align: center;
color: #999;
font-size: 14px;
margin: 20px 0;
}
.dropzone .dz-preview {
display: none !important;
}