From 8e8e8161bbe1701cbc67afb672c941a2ec1867ee Mon Sep 17 00:00:00 2001 From: MacRimi Date: Wed, 19 Nov 2025 17:30:01 +0100 Subject: [PATCH] Update AppImage --- AppImage/components/network-metrics.tsx | 16 ++++++++++++---- AppImage/components/system-overview.tsx | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/AppImage/components/network-metrics.tsx b/AppImage/components/network-metrics.tsx index c6737b9..5320689 100644 --- a/AppImage/components/network-metrics.tsx +++ b/AppImage/components/network-metrics.tsx @@ -206,8 +206,12 @@ export function NetworkMetrics() { ) } - const trafficInFormatted = formatNetworkTraffic(networkTotals.received * 1024 * 1024 * 1024, networkUnit) - const trafficOutFormatted = formatNetworkTraffic(networkTotals.sent * 1024 * 1024 * 1024, networkUnit) + const trafficInFormatted = networkUnit === "Bits" + ? `${(networkTotals.received * 8).toFixed(2)} Gb` + : `${networkTotals.received.toFixed(2)} GB` + const trafficOutFormatted = networkUnit === "Bits" + ? `${(networkTotals.sent * 8).toFixed(2)} Gb` + : `${networkTotals.sent.toFixed(2)} GB` const packetsRecvK = networkData.traffic.packets_recv ? (networkData.traffic.packets_recv / 1000).toFixed(0) : "0" const totalErrors = (networkData.traffic.errin || 0) + (networkData.traffic.errout || 0) @@ -883,7 +887,9 @@ export function NetworkMetrics() { {networkUnit === "Bits" ? "Bits Received" : "Bytes Received"}
- {formatNetworkTraffic(interfaceTotals.received * 1024 * 1024 * 1024, networkUnit)} + {networkUnit === "Bits" + ? `${(interfaceTotals.received * 8).toFixed(2)} Gb` + : `${interfaceTotals.received.toFixed(2)} GB`}
@@ -891,7 +897,9 @@ export function NetworkMetrics() { {networkUnit === "Bits" ? "Bits Sent" : "Bytes Sent"}
- {formatNetworkTraffic(interfaceTotals.sent * 1024 * 1024 * 1024, networkUnit)} + {networkUnit === "Bits" + ? `${(interfaceTotals.sent * 8).toFixed(2)} Gb` + : `${interfaceTotals.sent.toFixed(2)} GB`}
diff --git a/AppImage/components/system-overview.tsx b/AppImage/components/system-overview.tsx index 8609355..98c4266 100644 --- a/AppImage/components/system-overview.tsx +++ b/AppImage/components/system-overview.tsx @@ -674,14 +674,14 @@ export function SystemOverview() {
Received: - ↓ {formatNetworkTraffic(networkTotals.received, networkUnit)} + ↓ {networkData.traffic.bytes_recv.toFixed(2)} {networkUnit === "Bits" ? "Gb" : "GB"} ({getTimeframeLabel(networkTimeframe)})
Sent: - ↑ {formatNetworkTraffic(networkTotals.sent, networkUnit)} + ↑ {networkData.traffic.bytes_sent.toFixed(2)} {networkUnit === "Bits" ? "Gb" : "GB"} ({getTimeframeLabel(networkTimeframe)})