Skip to content

Commit

Permalink
fix: net transfer display error
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 1, 2024
1 parent 7e259f2 commit f46dd8e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/Server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ export default function Servers() {
)?.length || 0;
const up =
nezhaWsData?.servers?.reduce(
(total, server) => total + server.state.net_out_transfer,
(total, server) =>
formatNezhaInfo(nezhaWsData.now, server).online
? total + (server.state?.net_out_transfer ?? 0)
: total,
0,
) || 0;
const down =
nezhaWsData?.servers?.reduce(
(total, server) => total + server.state.net_in_transfer,
(total, server) =>
formatNezhaInfo(nezhaWsData.now, server).online
? total + (server.state?.net_in_transfer ?? 0)
: total,
0,
) || 0;

Expand Down

0 comments on commit f46dd8e

Please sign in to comment.