mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-27 07:34:12 +08:00
chore: fix typos
This commit is contained in:
parent
d0c7c1569d
commit
9fb91e764b
@ -9,7 +9,7 @@ type WsMsg = {
|
|||||||
downloadTotal: number
|
downloadTotal: number
|
||||||
} | null
|
} | null
|
||||||
|
|
||||||
// we make allconnections global so we can keep track of connections when user in proxy page
|
// we make connections global, so we can keep track of connections when user in proxy page
|
||||||
// when user selects proxy and close some connections they can back and check connections
|
// when user selects proxy and close some connections they can back and check connections
|
||||||
// they closed
|
// they closed
|
||||||
const [allConnectionsWithSpeed, setAllConnectionsWithSpeed] = createSignal<
|
const [allConnectionsWithSpeed, setAllConnectionsWithSpeed] = createSignal<
|
||||||
@ -40,7 +40,7 @@ export const useConnections = () => {
|
|||||||
const prevMap = new Map<string, Connection>()
|
const prevMap = new Map<string, Connection>()
|
||||||
prevActiveConnections.forEach((prev) => prevMap.set(prev.id, prev))
|
prevActiveConnections.forEach((prev) => prevMap.set(prev.id, prev))
|
||||||
|
|
||||||
const activeConnnections: ConnectionWithSpeed[] = connections.map(
|
const activeConnections: ConnectionWithSpeed[] = connections.map(
|
||||||
(connection) => {
|
(connection) => {
|
||||||
const prevConn = prevMap.get(connection.id)
|
const prevConn = prevMap.get(connection.id)
|
||||||
|
|
||||||
@ -60,17 +60,17 @@ export const useConnections = () => {
|
|||||||
|
|
||||||
const allConnections = unionWith(
|
const allConnections = unionWith(
|
||||||
allConnectionsWithSpeed(),
|
allConnectionsWithSpeed(),
|
||||||
activeConnnections,
|
activeConnections,
|
||||||
(a, b) => a.id === b.id,
|
(a, b) => a.id === b.id,
|
||||||
)
|
)
|
||||||
const closedConnections = differenceWith(
|
const closedConnections = differenceWith(
|
||||||
allConnections,
|
allConnections,
|
||||||
activeConnnections,
|
activeConnections,
|
||||||
(a, b) => a.id === b.id,
|
(a, b) => a.id === b.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
activeConns: activeConnnections.slice(-200),
|
activeConns: activeConnections.slice(-200),
|
||||||
closedConns: closedConnections.slice(-200),
|
closedConns: closedConnections.slice(-200),
|
||||||
allConns: allConnections.slice(-400),
|
allConns: allConnections.slice(-400),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user