Add background upload management feature

- Add BackgroundUploadManager class for managing uploads in background
- Create background upload button and panel UI
- Implement upload state transfer when modal closes
- Add real-time progress tracking for background uploads
- Support up to 5 concurrent uploads
- Display upload progress with percentage and chunk info
- Auto-hide background UI when all uploads complete
- Add responsive design for background panel
This commit is contained in:
admin
2026-01-23 15:46:51 +08:00
parent 6f3cc6b725
commit 2074d4fb78
2 changed files with 458 additions and 3 deletions

View File

@@ -224,6 +224,178 @@ body {
background: #d32f2f;
}
.btn-info {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
}
.btn-info:hover:not(:disabled) {
background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}
.background-btn {
animation: pulse 2s infinite;
font-size: 13px;
padding: 6px 12px;
white-space: nowrap;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.02); }
100% { transform: scale(1); }
}
.background-panel {
position: fixed;
bottom: 20px;
right: 20px;
width: 350px;
max-height: 400px;
background: white;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
z-index: 1000;
display: none;
flex-direction: column;
}
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid #f0f0f0;
background: #f8f9fa;
border-radius: 8px 8px 0 0;
}
.panel-header h4 {
margin: 0;
font-size: 14px;
color: #333;
font-weight: 600;
}
.close-btn {
background: none;
border: none;
font-size: 18px;
color: #999;
cursor: pointer;
padding: 0;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.close-btn:hover {
background: #e9ecef;
color: #666;
}
.background-content {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
.background-list {
flex: 1;
overflow-y: auto;
max-height: 350px;
}
.empty-state {
padding: 40px 20px;
text-align: center;
color: #999;
font-size: 14px;
}
.background-item {
display: flex;
align-items: center;
padding: 10px;
border-bottom: 1px solid #f0f0f0;
transition: background-color 0.2s;
}
.background-item:hover {
background: #f8f9fa;
}
.background-item:last-child {
border-bottom: none;
}
.item-icon {
font-size: 16px;
width: 24px;
text-align: center;
flex-shrink: 0;
}
.item-info {
flex: 1;
min-width: 0;
margin-left: 10px;
}
.item-name {
font-size: 12px;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 4px;
font-weight: 500;
}
.item-progress {
display: flex;
align-items: center;
gap: 8px;
}
.progress-bar {
width: 80px;
height: 4px;
background: #e0e0e0;
border-radius: 2px;
overflow: hidden;
flex-shrink: 0;
}
.progress-fill {
height: 100%;
background: #2196f3;
border-radius: 2px;
transition: width 0.3s ease;
}
.progress-text {
font-size: 11px;
color: #666;
font-family: monospace;
min-width: 60px;
}
.item-status {
width: 20px;
text-align: center;
flex-shrink: 0;
}
.status-icon {
font-size: 14px;
}
.file-list-container {
background: #fff;
border-radius: 6px;