From 231a66931b4a91f13b78672d0636ff4c2a55e238 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Fri, 13 Dec 2024 10:11:00 +0800 Subject: [PATCH] fix: ip info error --- app/(main)/ClientComponents/ServerIPInfo.tsx | 166 +++++++++++-------- 1 file changed, 94 insertions(+), 72 deletions(-) diff --git a/app/(main)/ClientComponents/ServerIPInfo.tsx b/app/(main)/ClientComponents/ServerIPInfo.tsx index eb430d8..ad7a91b 100644 --- a/app/(main)/ClientComponents/ServerIPInfo.tsx +++ b/app/(main)/ClientComponents/ServerIPInfo.tsx @@ -26,78 +26,100 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) { return ( <>
- - -
-

{"ASN"}

-
- {data.asn.autonomous_system_organization} -
-
-
-
- - -
-

{t("asn_number")}

-
- AS{data.asn.autonomous_system_number} -
-
-
-
- - -
-

- {t("registered_country")} -

-
- {data.city.registered_country?.names.en} -
-
-
-
- - -
-

{"ISO"}

-
{data.city.country?.iso_code}
-
-
-
- - -
-

{t("city")}

-
{data.city.city?.names.en}
-
-
-
- - -
-

{t("longitude")}

-
{data.city.location?.longitude}
-
-
-
- - -
-

{t("latitude")}

-
{data.city.location?.latitude}
-
-
-
- - -
-

{t("time_zone")}

-
{data.city.location?.time_zone}
-
-
-
+ {data.asn.autonomous_system_organization && ( + + +
+

{"ASN"}

+
+ {data.asn.autonomous_system_organization} +
+
+
+
+ )} + {data.asn.autonomous_system_number && ( + + +
+

+ {t("asn_number")} +

+
+ AS{data.asn.autonomous_system_number} +
+
+
+
+ )} + {data.city.registered_country?.names.en && ( + + +
+

+ {t("registered_country")} +

+
+ {data.city.registered_country?.names.en} +
+
+
+
+ )} + {data.city.country?.iso_code && ( + + +
+

{"ISO"}

+
{data.city.country?.iso_code}
+
+
+
+ )} + {data.city.city?.names.en && ( + + +
+

{t("city")}

+
{data.city.city?.names.en}
+
+
+
+ )} + {data.city.location?.longitude && ( + + +
+

+ {t("longitude")} +

+
{data.city.location?.longitude}
+
+
+
+ )} + {data.city.location?.latitude && ( + + +
+

{t("latitude")}

+
{data.city.location?.latitude}
+
+
+
+ )} + {data.city.location?.time_zone && ( + + +
+

+ {t("time_zone")} +

+
{data.city.location?.time_zone}
+
+
+
+ )} {data.city.postal && (