mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-21 08:18:42 +08:00
1 parent
1fa3ffb1ff
commit
b6ea73af83
1 file changed
+13
-1
@@ -21,7 +21,11 @@ import { BaseStyledSelect } from "@/components/base/base-styled-select";
|
|||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
import { createSockette } from "@/utils/websocket";
|
import { createSockette } from "@/utils/websocket";
|
||||||
|
|
||||||
const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] };
|
const initConn: IConnections = {
|
||||||
|
uploadTotal: 0,
|
||||||
|
downloadTotal: 0,
|
||||||
|
connections: [],
|
||||||
|
};
|
||||||
|
|
||||||
type OrderFunc = (list: IConnectionsItem[]) => IConnectionsItem[];
|
type OrderFunc = (list: IConnectionsItem[]) => IConnectionsItem[];
|
||||||
|
|
||||||
@@ -94,9 +98,16 @@ const ConnectionsPage = () => {
|
|||||||
return { ...data, connections };
|
return { ...data, connections };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onerror(event) {
|
||||||
|
next(event);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
s.close();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const [filterConn, download, upload] = useMemo(() => {
|
const [filterConn, download, upload] = useMemo(() => {
|
||||||
@@ -106,6 +117,7 @@ const ConnectionsPage = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (orderFunc) connections = orderFunc(connections);
|
if (orderFunc) connections = orderFunc(connections);
|
||||||
|
|
||||||
let download = 0;
|
let download = 0;
|
||||||
let upload = 0;
|
let upload = 0;
|
||||||
connections.forEach((x) => {
|
connections.forEach((x) => {
|
||||||
|
|||||||
Reference in new issue
Block a user