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