分开上下行统计

This commit is contained in:
CN-JS-HuiBai
2026-04-05 18:06:11 +08:00
parent 9e827c9831
commit aed9147074
4 changed files with 34 additions and 12 deletions

View File

@@ -19,7 +19,8 @@
memDetail: document.getElementById('memDetail'),
diskPercent: document.getElementById('diskPercent'),
diskDetail: document.getElementById('diskDetail'),
totalBandwidth: document.getElementById('totalBandwidth'),
totalBandwidthTx: document.getElementById('totalBandwidthTx'),
totalBandwidthRx: document.getElementById('totalBandwidthRx'),
bandwidthDetail: document.getElementById('bandwidthDetail'),
traffic24hRx: document.getElementById('traffic24hRx'),
traffic24hTx: document.getElementById('traffic24hTx'),
@@ -570,8 +571,9 @@
dom.diskDetail.textContent = `${formatBytes(data.disk.used)}/${formatBytes(data.disk.total)}`;
// Bandwidth
dom.totalBandwidth.textContent = formatBandwidth(data.network.total || 0);
dom.bandwidthDetail.textContent = `${formatBandwidth(data.network.rx)}${formatBandwidth(data.network.tx)}`;
dom.totalBandwidthTx.textContent = formatBandwidth(data.network.tx || 0);
dom.totalBandwidthRx.textContent = formatBandwidth(data.network.rx || 0);
dom.bandwidthDetail.textContent = `当前实时数据聚合`;
// 24h traffic
dom.traffic24hRx.textContent = formatBytes(data.traffic24h.rx);
@@ -586,7 +588,7 @@
// Flash animation
if (previousMetrics) {
[dom.cpuPercent, dom.memPercent, dom.diskPercent, dom.totalBandwidth].forEach(el => {
[dom.cpuPercent, dom.memPercent, dom.diskPercent, dom.totalBandwidthTx, dom.totalBandwidthRx].forEach(el => {
el.classList.remove('value-update');
void el.offsetWidth; // Force reflow
el.classList.add('value-update');