From 46958194a434eae763612c3f74d8eec5e44577c7 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 20 Oct 2024 00:36:22 +0800 Subject: [PATCH] fix: error message --- .../ClientComponents/ServerListClient.tsx | 2 +- .../ClientComponents/ServerOverviewClient.tsx | 217 +++++++++--------- 2 files changed, 111 insertions(+), 108 deletions(-) diff --git a/app/[locale]/(main)/ClientComponents/ServerListClient.tsx b/app/[locale]/(main)/ClientComponents/ServerListClient.tsx index eea8010e6..2f163baaf 100644 --- a/app/[locale]/(main)/ClientComponents/ServerListClient.tsx +++ b/app/[locale]/(main)/ClientComponents/ServerListClient.tsx @@ -24,7 +24,7 @@ export default function ServerListClient() {
{t("error_message")}
); - if (!data) return null; + if (!data?.result) return null; const { result } = data; diff --git a/app/[locale]/(main)/ClientComponents/ServerOverviewClient.tsx b/app/[locale]/(main)/ClientComponents/ServerOverviewClient.tsx index c8582eb7d..ebfa63cf3 100644 --- a/app/[locale]/(main)/ClientComponents/ServerOverviewClient.tsx +++ b/app/[locale]/(main)/ClientComponents/ServerOverviewClient.tsx @@ -12,7 +12,10 @@ import useSWR from "swr"; export default function ServerOverviewClient() { const t = useTranslations("ServerOverviewClient"); - const { data, error } = useSWR{t("no_data_message")}
-- {t("p_816-881_Totalservers")} -
-- {t("p_1610-1676_Onlineservers")} -
-- {t("p_2532-2599_Offlineservers")} -
-+ {t("p_816-881_Totalservers")} +
++ {t("p_1610-1676_Onlineservers")} +
++ {t("p_2532-2599_Offlineservers")} +
++ {t("p_3463-3530_Totalbandwidth")} +
+ {data?.result ? ( ++ ↑{formatBytes(data?.total_out_bandwidth)} +
++ ↓{formatBytes(data?.total_in_bandwidth)} +
+- {t("p_3463-3530_Totalbandwidth")} -
- {data ? ( -- ↑{formatBytes(data?.total_out_bandwidth)} -
-- ↓{formatBytes(data?.total_in_bandwidth)} -
-{t("error_message")}
+