From ffcbf4489ef8c1d606fca19a9d9c515db84c87e3 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 15 Dec 2024 02:11:31 +0800 Subject: [PATCH] feat: disableShowNetTransfer env --- src/components/ServerCard.tsx | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/components/ServerCard.tsx b/src/components/ServerCard.tsx index 25a0ef7..8d0c6e2 100644 --- a/src/components/ServerCard.tsx +++ b/src/components/ServerCard.tsx @@ -27,6 +27,8 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf } = formatNezhaInfo(now, serverInfo) const showFlag = true + // @ts-expect-error ShowNetTransfer is a global variable + const disableShowNetTransfer = window.ShowNetTransfer === "false" const parsedData = parsePublicNote(public_note) @@ -121,27 +123,30 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf -
- - {t("serverCard.upload")}:{formatBytes(net_out_transfer)} - - - {t("serverCard.download")}:{formatBytes(net_in_transfer)} - -
+ {!disableShowNetTransfer && ( +
+ + {t("serverCard.upload")}:{formatBytes(net_out_transfer)} + + + {t("serverCard.download")}:{formatBytes(net_in_transfer)} + +
+ )} ) : ( navigate(`/server/${serverInfo.id}`, { replace: true })} >