修复泄露IP的严重BUG
This commit is contained in:
@@ -380,8 +380,15 @@ class MetricChart {
|
||||
ctx.textAlign = 'right';
|
||||
|
||||
let label = '';
|
||||
if (this.unit === 'B/s') {
|
||||
label = window.formatBandwidth ? window.formatBandwidth(v) : v.toFixed(0);
|
||||
if (this.unit === 'B/s' || this.unit === 'B') {
|
||||
const isRate = this.unit === 'B/s';
|
||||
if (window.formatBandwidth && isRate) {
|
||||
label = window.formatBandwidth(v);
|
||||
} else if (window.formatBytes) {
|
||||
label = window.formatBytes(v) + (isRate ? '/s' : '');
|
||||
} else {
|
||||
label = v.toFixed(0) + this.unit;
|
||||
}
|
||||
} else {
|
||||
label = (v >= 1000 ? (v / 1000).toFixed(1) + 'k' : v.toFixed(v < 10 && v > 0 ? 1 : 0)) + this.unit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user