2D 地图路由修复:

服务器详情体验增强:
This commit is contained in:
CN-JS-HuiBai
2026-04-09 12:50:40 +08:00
parent 06ddd5a8e1
commit 09f20ec81d
3 changed files with 18 additions and 2 deletions

View File

@@ -477,6 +477,10 @@ class MetricChart {
} else {
label = v.toFixed(0) + this.unit;
}
} else if (this.unit === '%' && this.totalValue) {
// 当提供了总量时,将百分比转换为实际数值显示(例如内存显示 2GB 而非 25%
const absVal = v * (this.totalValue / 100);
label = window.formatBytes ? window.formatBytes(absVal) : absVal.toFixed(0);
} else {
label = (v >= 1000 ? (v / 1000).toFixed(1) + 'k' : v.toFixed(v < 10 && v > 0 ? 1 : 0)) + this.unit;
}