fix: 补上 dashboard 缺失的 formatBytes 函数定义
This commit is contained in:
@@ -642,6 +642,13 @@
|
|||||||
return `${m}m`;
|
return `${m}m`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatBytes = (b) => {
|
||||||
|
if (!b) return "0 B";
|
||||||
|
const k = 1024, sizes = ["B", "KB", "MB", "GB"];
|
||||||
|
const i = Math.floor(Math.log(b) / Math.log(k));
|
||||||
|
return (b / Math.pow(k, i)).toFixed(1) + " " + sizes[i];
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
refresh();
|
refresh();
|
||||||
setInterval(refresh, 10000);
|
setInterval(refresh, 10000);
|
||||||
|
|||||||
Reference in New Issue
Block a user