deving
This commit is contained in:
@@ -167,3 +167,25 @@ function formatFileSize(bytes) {
|
|||||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 跳转到上传页面
|
||||||
|
async function goToUpload() {
|
||||||
|
try {
|
||||||
|
// 上传页面需要GET请求,直接跳转
|
||||||
|
window.location.href = '/';
|
||||||
|
} catch (error) {
|
||||||
|
console.error('跳转失败:', error);
|
||||||
|
window.location.href = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到主页
|
||||||
|
async function goToHome() {
|
||||||
|
try {
|
||||||
|
// 主页需要GET请求,直接跳转
|
||||||
|
window.location.href = '/';
|
||||||
|
} catch (error) {
|
||||||
|
console.error('跳转失败:', error);
|
||||||
|
window.location.href = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -185,10 +185,10 @@
|
|||||||
<p>查看所有上传的STP文件分析记录</p>
|
<p>查看所有上传的STP文件分析记录</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-buttons">
|
<div class="nav-buttons">
|
||||||
<button class="upload-btn" onclick="location.href='/upload'">
|
<button class="upload-btn" onclick="goToUpload()">
|
||||||
📁 上传新文件
|
📁 上传新文件
|
||||||
</button>
|
</button>
|
||||||
<button class="upload-btn" onclick="location.href='/'">
|
<button class="upload-btn" onclick="goToHome()">
|
||||||
🔄 返回主页
|
🔄 返回主页
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user