重构前端ui

This commit is contained in:
qaq
2025-07-03 11:31:59 +08:00
parent f8f83039f9
commit 58353dec5c
7 changed files with 46 additions and 19 deletions
+1 -10
View File
@@ -266,16 +266,7 @@ export default function NodePage() {
})));
};
// 格式化字节数
const formatBytes = (bytes: number): string => {
if (bytes === 0) return '0 B';
const k = 1024;
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
};
// 格式化速度
const formatSpeed = (bytesPerSecond: number): string => {