mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
fix: connections page traffic calculation
This commit is contained in:
parent
1378068a30
commit
bb1dbfcfc3
@ -178,7 +178,7 @@
|
||||
"Process": "Process",
|
||||
"Time": "Time",
|
||||
"Source": "Source",
|
||||
"Destination": "Destination IP",
|
||||
"Destination": "Destination",
|
||||
"DestinationPort": "Destination Port",
|
||||
"Close Connection": "Close Connection",
|
||||
"Rules": "Rules",
|
||||
|
@ -127,9 +127,8 @@ const ConnectionsPage = () => {
|
||||
return isPaused ? (frozenData ?? connData) : connData;
|
||||
}, [isPaused, frozenData, connData]);
|
||||
|
||||
const [filterConn, download, upload] = useMemo(() => {
|
||||
const [filterConn] = useMemo(() => {
|
||||
const orderFunc = orderOpts[curOrderOpt];
|
||||
|
||||
let connections = displayData.connections.filter((conn) => {
|
||||
const { host, destinationIP, process } = conn.metadata;
|
||||
return (
|
||||
@ -139,13 +138,7 @@ const ConnectionsPage = () => {
|
||||
|
||||
if (orderFunc) connections = orderFunc(connections);
|
||||
|
||||
let download = 0;
|
||||
let upload = 0;
|
||||
connections.forEach((x) => {
|
||||
download += x.download;
|
||||
upload += x.upload;
|
||||
});
|
||||
return [connections, download, upload];
|
||||
return [connections];
|
||||
}, [displayData, match, curOrderOpt]);
|
||||
|
||||
const onCloseAll = useLockFn(closeAllConnections);
|
||||
@ -181,10 +174,10 @@ const ConnectionsPage = () => {
|
||||
header={
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
|
||||
<Box sx={{ mx: 1 }}>
|
||||
{t("Downloaded")}: {parseTraffic(download)}
|
||||
{t("Downloaded")}: {parseTraffic(displayData.downloadTotal)}
|
||||
</Box>
|
||||
<Box sx={{ mx: 1 }}>
|
||||
{t("Uploaded")}: {parseTraffic(upload)}
|
||||
{t("Uploaded")}: {parseTraffic(displayData.uploadTotal)}
|
||||
</Box>
|
||||
<IconButton
|
||||
color="inherit"
|
||||
|
Loading…
x
Reference in New Issue
Block a user