Skip to content

Commit 65e207c

Browse files
committed
chore: 优化面板的进度条
1 parent 412f908 commit 65e207c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

assets/js/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,18 @@ async function load() {
14581458
var d = Tools.formatCountTime(e);
14591459
var running = Tools.formatCountTime(data.current_time - data.start_time);
14601460
var postfix = data.postfix == null ? "" : ", " + data.postfix;
1461+
var current = data.current;
1462+
var total = data.total;
1463+
if (data.unit == "b") {
1464+
speed = Tools.formatBytes(speed)
1465+
current = Tools.formatBytes(current)
1466+
total = Tools.formatBytes(total)
1467+
data.unit = ""
1468+
} else {
1469+
speed = Tools.formatUnitNumber(speed)
1470+
current = Tools.formatUnitNumber(current)
1471+
total = Tools.formatUnitNumber(total)
1472+
}
14611473
$dashboard_locals.info_progressbar_bar.postfix.text(`${data.current}/${data.total} [${running}<${d}, ${speed.toFixed(2)}${data.unit}/s${postfix}]`)
14621474
}
14631475

0 commit comments

Comments
 (0)