Fix upload progress and JavaScript syntax errors

This commit is contained in:
admin
2026-01-23 09:43:04 +08:00
parent 02aafabc47
commit 88db4903c9
3 changed files with 530 additions and 533 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>📁 文件管理器</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📁</text></svg>">
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
@@ -128,6 +129,7 @@
<div class="upload-progress-bar" id="upload-progress-bar"></div>
</div>
<div class="upload-stats" id="upload-stats"></div>
<div class="upload-speed" id="upload-speed"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" id="upload-cancel" style="display: none;">取消</button>

View File

@@ -8,40 +8,41 @@ body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: #f5f5f5;
color: #333;
line-height: 1.6;
line-height: 1.5;
font-size: 13px;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
padding: 10px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0;
border-bottom: 2px solid #e0e0e0;
margin-bottom: 20px;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
margin-bottom: 10px;
}
.header h1 {
font-size: 28px;
font-size: 20px;
color: #2c3e50;
}
.status {
display: flex;
align-items: center;
gap: 20px;
font-size: 14px;
gap: 15px;
font-size: 12px;
color: #666;
}
#connection-status {
padding: 5px 12px;
border-radius: 20px;
padding: 3px 10px;
border-radius: 15px;
font-weight: 500;
}
@@ -58,27 +59,29 @@ body {
#path-display {
font-family: 'Monaco', 'Consolas', monospace;
background: #e3f2fd;
padding: 5px 15px;
border-radius: 5px;
padding: 3px 10px;
border-radius: 4px;
color: #1565c0;
font-size: 12px;
}
.breadcrumb {
display: flex;
flex-wrap: wrap;
gap: 5px;
padding: 10px 15px;
gap: 3px;
padding: 8px 12px;
background: #fff;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
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: 5px 10px;
border-radius: 4px;
padding: 3px 6px;
border-radius: 3px;
transition: background 0.2s;
}
@@ -94,7 +97,7 @@ body {
.crumb:not(:last-child)::after {
content: '/';
margin-left: 5px;
margin-left: 3px;
color: #999;
}
@@ -103,29 +106,29 @@ body {
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px;
padding: 15px;
gap: 8px;
padding: 10px 12px;
background: #fff;
border-radius: 8px;
border-radius: 6px;
margin-bottom: 0;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.toolbar-left,
.toolbar-right {
display: flex;
gap: 10px;
gap: 6px;
}
.search-toolbar {
display: flex;
justify-content: center;
padding: 12px 15px;
padding: 8px 12px;
background: #fff;
border-radius: 8px;
margin-top: 15px;
margin-bottom: 15px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
border-radius: 6px;
margin-top: 10px;
margin-bottom: 10px;
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
width: 100%;
}
@@ -133,9 +136,9 @@ body {
display: flex;
align-items: center;
background: #f8f8f8;
border: 2px solid #e8e8e8;
border-radius: 8px;
padding: 6px 12px;
border: 1px solid #e0e0e0;
border-radius: 4px;
padding: 4px 10px;
width: 90%;
max-width: 90%;
transition: all 0.2s;
@@ -144,15 +147,14 @@ body {
.search-box:focus-within {
border-color: #2196f3;
background: #fff;
box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}
.search-box input {
flex: 1;
border: none;
background: transparent;
padding: 6px;
font-size: 14px;
padding: 4px;
font-size: 13px;
outline: none;
}
@@ -164,15 +166,8 @@ body {
background: none;
border: none;
cursor: pointer;
font-size: 16px;
padding: 4px 6px;
opacity: 0.7;
transition: opacity 0.2s;
}
.search-btn:hover {
opacity: 1;
}
font-size: 14px;
padding: 2px 4px;
opacity: 0.7;
transition: opacity 0.2s;
}
@@ -182,14 +177,17 @@ body {
}
.btn {
padding: 10px 20px;
padding: 6px 12px;
border: none;
border-radius: 6px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-size: 12px;
font-weight: 500;
display: flex;
align-items: center;
gap: 4px;
transition: all 0.2s;
}
gap: 5px;
transition: all 0.2s;
}
@@ -228,8 +226,8 @@ body {
.file-list-container {
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
overflow: hidden;
}
@@ -240,16 +238,17 @@ body {
.file-list th,
.file-list td {
padding: 12px 15px;
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: 13px;
font-size: 11px;
text-transform: uppercase;
}
@@ -266,31 +265,32 @@ body {
}
.col-checkbox {
width: 50px;
width: 40px;
}
.col-name {
min-width: 200px;
min-width: 150px;
}
.col-size {
width: 120px;
width: 80px;
}
.col-time {
width: 180px;
width: 140px;
}
.col-actions {
width: 150px;
width: 120px;
}
.file-name {
display: flex;
align-items: center;
gap: 8px;
gap: 6px;
cursor: pointer;
color: #1976d2;
font-size: 13px;
}
.file-name:hover {
@@ -303,26 +303,26 @@ body {
}
.file-icon {
font-size: 20px;
font-size: 16px;
}
.file-size {
color: #666;
font-size: 13px;
font-size: 12px;
}
.file-time {
color: #666;
font-size: 13px;
font-size: 12px;
}
.file-actions {
display: flex;
gap: 8px;
gap: 4px;
}
.action-btn {
padding: 5px 10px;
padding: 3px 6px;
border: none;
background: transparent;
cursor: pointer;
@@ -670,15 +670,15 @@ body {
}
.upload-list {
max-height: 300px;
max-height: 280px;
overflow-y: auto;
margin-bottom: 15px;
margin-bottom: 12px;
}
.upload-item {
display: flex;
align-items: center;
padding: 10px;
padding: 8px 10px;
border-bottom: 1px solid #eee;
gap: 10px;
}
@@ -688,7 +688,7 @@ body {
}
.upload-item-icon {
font-size: 24px;
font-size: 20px;
}
.upload-item-info {
@@ -698,23 +698,48 @@ body {
.upload-item-name {
font-weight: 500;
margin-bottom: 4px;
margin-bottom: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
}
.upload-item-status {
font-size: 12px;
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: 8px;
height: 6px;
background: #e0e0e0;
border-radius: 4px;
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
margin-bottom: 8px;
display: none;
}
@@ -725,14 +750,14 @@ body {
.upload-progress-bar {
height: 100%;
background: linear-gradient(90deg, #2196f3, #4caf50);
border-radius: 4px;
transition: width 0.3s ease;
border-radius: 3px;
transition: width 0.2s ease;
width: 0%;
}
.upload-stats {
text-align: center;
font-size: 14px;
font-size: 12px;
color: #666;
display: none;
}
@@ -740,3 +765,15 @@ body {
.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;
}