Files
auto-index-go/static/style.css
admin 2074d4fb78 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
2026-01-23 15:46:51 +08:00

1130 lines
18 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: #f5f5f5;
color: #333;
line-height: 1.5;
font-size: 13px;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 10px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
margin-bottom: 10px;
}
.header h1 {
font-size: 20px;
color: #2c3e50;
}
.status {
display: flex;
align-items: center;
gap: 15px;
font-size: 12px;
color: #666;
}
#connection-status {
padding: 3px 10px;
border-radius: 15px;
font-weight: 500;
}
#connection-status.connected {
background: #e8f5e9;
color: #2e7d32;
}
#connection-status.disconnected {
background: #ffebee;
color: #c62828;
}
#path-display {
font-family: 'Monaco', 'Consolas', monospace;
background: #e3f2fd;
padding: 3px 10px;
border-radius: 4px;
color: #1565c0;
font-size: 12px;
}
.breadcrumb {
display: flex;
flex-wrap: wrap;
gap: 3px;
padding: 8px 12px;
background: #fff;
border-radius: 6px;
margin-bottom: 10px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
font-size: 12px;
}
.crumb {
color: #1976d2;
cursor: pointer;
padding: 3px 6px;
border-radius: 3px;
transition: background 0.2s;
}
.crumb:hover {
background: #e3f2fd;
}
.crumb:last-child {
color: #333;
cursor: default;
background: transparent;
}
.crumb:not(:last-child)::after {
content: '/';
margin-left: 3px;
color: #999;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 8px;
padding: 10px 12px;
background: #fff;
border-radius: 6px;
margin-bottom: 0;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.toolbar-left,
.toolbar-right {
display: flex;
gap: 6px;
}
.search-toolbar {
display: flex;
justify-content: center;
padding: 8px 12px;
background: #fff;
border-radius: 6px;
margin-top: 10px;
margin-bottom: 10px;
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
width: 100%;
}
.search-box {
display: flex;
align-items: center;
background: #f8f8f8;
border: 1px solid #e0e0e0;
border-radius: 4px;
padding: 4px 10px;
width: 90%;
max-width: 90%;
transition: all 0.2s;
}
.search-box:focus-within {
border-color: #2196f3;
background: #fff;
}
.search-box input {
flex: 1;
border: none;
background: transparent;
padding: 4px;
font-size: 13px;
outline: none;
}
.search-box input::placeholder {
color: #999;
}
.search-btn {
background: none;
border: none;
cursor: pointer;
font-size: 14px;
padding: 2px 4px;
opacity: 0.7;
transition: opacity 0.2s;
}
.search-btn:hover {
opacity: 1;
}
.btn {
padding: 6px 12px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
font-weight: 500;
display: flex;
align-items: center;
gap: 4px;
transition: all 0.2s;
}
gap: 5px;
transition: all 0.2s;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-primary {
background: #2196f3;
color: white;
}
.btn-primary:hover:not(:disabled) {
background: #1976d2;
}
.btn-secondary {
background: #f5f5f5;
color: #333;
}
.btn-secondary:hover:not(:disabled) {
background: #e0e0e0;
}
.btn-danger {
background: #f44336;
color: white;
}
.btn-danger:hover:not(:disabled) {
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;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
overflow: hidden;
}
.file-list {
width: 100%;
border-collapse: collapse;
}
.file-list th,
.file-list td {
padding: 8px 12px;
text-align: left;
border-bottom: 1px solid #eee;
font-size: 12px;
}
.file-list th {
background: #fafafa;
font-weight: 600;
color: #666;
font-size: 11px;
text-transform: uppercase;
}
.file-list tbody tr {
transition: background 0.2s;
}
.file-list tbody tr:hover {
background: #f5f5f5;
}
.file-list tbody tr.selected {
background: #e3f2fd;
}
.col-checkbox {
width: 40px;
}
.col-name {
min-width: 150px;
}
.col-size {
width: 80px;
}
.col-time {
width: 140px;
}
.col-actions {
width: 120px;
}
.file-name {
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
color: #1976d2;
font-size: 13px;
}
.file-name:hover {
text-decoration: underline;
}
.file-name.is-dir {
color: #2e7d32;
font-weight: 500;
}
.file-icon {
font-size: 16px;
}
.file-size {
color: #666;
font-size: 12px;
}
.file-time {
color: #666;
font-size: 12px;
}
.file-actions {
display: flex;
gap: 4px;
}
.action-btn {
padding: 3px 6px;
border: none;
background: transparent;
cursor: pointer;
font-size: 14px;
border-radius: 4px;
transition: background 0.2s;
}
.action-btn:hover {
background: #e0e0e0;
}
.action-btn.delete:hover {
background: #ffebee;
color: #c62828;
}
.drop-zone {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(33, 150, 243, 0.9);
z-index: 1000;
justify-content: center;
align-items: center;
}
.drop-zone.active {
display: flex;
}
.drop-zone-content {
text-align: center;
color: white;
}
.drop-icon {
font-size: 80px;
display: block;
margin-bottom: 20px;
}
.drop-zone-content p {
font-size: 24px;
}
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 1000;
justify-content: center;
align-items: center;
padding: 20px;
}
.modal.active {
display: flex;
}
.modal-content {
background: white;
border-radius: 12px;
width: 100%;
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;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #eee;
}
.modal-header h3 {
font-size: 18px;
color: #333;
}
.modal-close {
background: none;
border: none;
font-size: 28px;
cursor: pointer;
color: #999;
line-height: 1;
}
.modal-close:hover {
color: #333;
}
.modal-body {
padding: 20px;
overflow-y: auto;
flex: 1;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 15px 20px;
border-top: 1px solid #eee;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
color: #666;
font-size: 14px;
}
.form-group input {
width: 100%;
padding: 10px 15px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
}
.form-group input:focus {
outline: none;
border-color: #2196f3;
}
.move-filename {
padding: 10px;
background: #f5f5f5;
border-radius: 6px;
margin-bottom: 15px;
font-family: monospace;
}
.dir-tree {
max-height: 300px;
overflow-y: auto;
border: 1px solid #eee;
border-radius: 6px;
padding: 10px;
}
.dir-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
cursor: pointer;
border-radius: 4px;
margin-bottom: 2px;
}
.dir-item:hover {
background: #f5f5f5;
}
.dir-item.selected {
background: #e3f2fd;
}
.dir-item.current {
background: #fff3e0;
}
.preview-image {
max-width: 100%;
max-height: 60vh;
display: block;
margin: 0 auto;
}
.preview-text {
white-space: pre-wrap;
font-family: 'Monaco', 'Consolas', monospace;
font-size: 13px;
line-height: 1.5;
max-height: 60vh;
overflow: auto;
background: #f5f5f5;
padding: 15px;
border-radius: 6px;
}
.preview-placeholder {
text-align: center;
padding: 60px 20px;
color: #999;
}
.preview-placeholder .icon {
font-size: 80px;
display: block;
margin-bottom: 20px;
}
.notification {
position: fixed;
bottom: 20px;
right: 20px;
padding: 15px 25px;
background: #333;
color: white;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
transform: translateY(100px);
opacity: 0;
transition: all 0.3s;
z-index: 2000;
}
.notification.show {
transform: translateY(0);
opacity: 1;
}
.notification.success {
background: #4caf50;
}
.notification.error {
background: #f44336;
}
.notification.info {
background: #2196f3;
}
.empty-message {
text-align: center;
padding: 60px 20px;
color: #999;
}
.empty-message .icon {
font-size: 60px;
display: block;
margin-bottom: 15px;
}
.loading {
text-align: center;
padding: 40px;
color: #666;
}
.loading::after {
content: '';
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid #e0e0e0;
border-top-color: #2196f3;
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin-left: 10px;
vertical-align: middle;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@media (max-width: 768px) {
.header {
flex-direction: column;
gap: 15px;
text-align: center;
}
.toolbar {
flex-direction: column;
}
.toolbar-left,
.toolbar-right {
justify-content: center;
width: 100%;
}
.search-toolbar {
order: -1;
width: 100%;
}
.search-box {
max-width: 100%;
}
.file-list th:nth-child(3),
.file-list td:nth-child(3),
.file-list th:nth-child(4),
.file-list td:nth-child(4) {
display: none;
}
.file-actions {
flex-direction: column;
gap: 2px;
}
}
.tooltip {
position: relative;
}
.tooltip::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
padding: 5px 10px;
background: #333;
color: white;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s;
}
.tooltip:hover::after {
opacity: 1;
}
.upload-list {
max-height: 280px;
overflow-y: auto;
margin-bottom: 12px;
}
.upload-item {
display: flex;
align-items: center;
padding: 8px 10px;
border-bottom: 1px solid #eee;
gap: 10px;
}
.upload-item:last-child {
border-bottom: none;
}
.upload-item-icon {
font-size: 20px;
}
.upload-item-info {
flex: 1;
min-width: 0;
}
.upload-item-name {
font-weight: 500;
margin-bottom: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
}
.upload-item-status {
font-size: 11px;
color: #666;
display: flex;
align-items: center;
gap: 8px;
}
.upload-item-size {
color: #999;
font-size: 11px;
}
.upload-item-progress {
width: 60px;
height: 4px;
background: #e0e0e0;
border-radius: 2px;
overflow: hidden;
}
.upload-item-progress-bar {
height: 100%;
background: #2196f3;
border-radius: 2px;
width: 0%;
transition: width 0.2s;
}
.upload-progress-container {
height: 6px;
background: #e0e0e0;
border-radius: 3px;
overflow: hidden;
margin-bottom: 8px;
display: none;
}
.upload-progress-container.active {
display: block;
}
.upload-progress-bar {
height: 100%;
background: linear-gradient(90deg, #2196f3, #4caf50);
border-radius: 3px;
transition: width 0.2s ease;
width: 0%;
}
.upload-stats {
text-align: center;
font-size: 12px;
color: #666;
display: none;
}
.upload-stats.active {
display: block;
}
.upload-speed {
text-align: center;
font-size: 12px;
color: #1976d2;
margin-bottom: 8px;
display: none;
}
.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;
}