fix: hide unknown field

This commit is contained in:
hamster1963 2024-12-04 14:43:49 +08:00
parent d7d68fe3a5
commit 1f9b667f0a

View File

@ -101,30 +101,30 @@ export default function ServerDetailOverview({
</section> </section>
</CardContent> </CardContent>
</Card> </Card>
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> {version && (
<CardContent className="px-1.5 py-1"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<section className="flex flex-col items-start gap-0.5"> <CardContent className="px-1.5 py-1">
<p className="text-xs text-muted-foreground"> <section className="flex flex-col items-start gap-0.5">
{t("serverDetail.version")} <p className="text-xs text-muted-foreground">
</p> {t("serverDetail.version")}
<div className="text-xs"> </p>
{version || t("serverDetail.unknown")}{" "} <div className="text-xs">{version} </div>
</div> </section>
</section> </CardContent>
</CardContent> </Card>
</Card> )}
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> {arch && (
<CardContent className="px-1.5 py-1"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<section className="flex flex-col items-start gap-0.5"> <CardContent className="px-1.5 py-1">
<p className="text-xs text-muted-foreground"> <section className="flex flex-col items-start gap-0.5">
{t("serverDetail.arch")} <p className="text-xs text-muted-foreground">
</p> {t("serverDetail.arch")}
<div className="text-xs"> </p>
{arch || t("serverDetail.unknown")}{" "} <div className="text-xs">{arch} </div>
</div> </section>
</section> </CardContent>
</CardContent> </Card>
</Card> )}
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<CardContent className="px-1.5 py-1"> <CardContent className="px-1.5 py-1">
<section className="flex flex-col items-start gap-0.5"> <section className="flex flex-col items-start gap-0.5">
@ -145,69 +145,65 @@ export default function ServerDetailOverview({
</section> </section>
</CardContent> </CardContent>
</Card> </Card>
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> {country_code && (
<CardContent className="px-1.5 py-1"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<section className="flex flex-col items-start gap-0.5"> <CardContent className="px-1.5 py-1">
<p className="text-xs text-muted-foreground"> <section className="flex flex-col items-start gap-0.5">
{t("serverDetail.region")} <p className="text-xs text-muted-foreground">
</p> {t("serverDetail.region")}
<section className="flex items-start gap-1"> </p>
<div className="text-xs text-start"> <section className="flex items-start gap-1">
{country_code?.toUpperCase() || t("serverDetail.unknown")} <div className="text-xs text-start">
</div> {country_code?.toUpperCase()}
{country_code && ( </div>
<ServerFlag {country_code && (
className="text-[11px] -mt-[1px]" <ServerFlag
country_code={country_code} className="text-[11px] -mt-[1px]"
/> country_code={country_code}
)} />
)}
</section>
</section> </section>
</section> </CardContent>
</CardContent> </Card>
</Card> )}
</section> </section>
<section className="flex flex-wrap gap-2 mt-1"> <section className="flex flex-wrap gap-2 mt-1">
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> {platform && (
<CardContent className="px-1.5 py-1"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<section className="flex flex-col items-start gap-0.5"> <CardContent className="px-1.5 py-1">
<p className="text-xs text-muted-foreground"> <section className="flex flex-col items-start gap-0.5">
{t("serverDetail.system")} <p className="text-xs text-muted-foreground">
</p> {t("serverDetail.system")}
{platform ? ( </p>
<div className="text-xs"> <div className="text-xs">
{" "} {" "}
{platform || t("serverDetail.unknown")} - {platform_version}{" "} {platform} - {platform_version || ""}{" "}
</div> </div>
) : ( </section>
<div className="text-xs"> {t("serverDetail.unknown")}</div> </CardContent>
)} </Card>
</section> )}
</CardContent> {cpu_info.length > 0 && (
</Card> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> <CardContent className="px-1.5 py-1">
<CardContent className="px-1.5 py-1"> <section className="flex flex-col items-start gap-0.5">
<section className="flex flex-col items-start gap-0.5"> <p className="text-xs text-muted-foreground">{"CPU"}</p>
<p className="text-xs text-muted-foreground">{"CPU"}</p>
{cpu_info.length > 0 ? (
<div className="text-xs"> {cpu_info.join(", ")}</div> <div className="text-xs"> {cpu_info.join(", ")}</div>
) : ( </section>
<div className="text-xs"> {t("serverDetail.unknown")}</div> </CardContent>
)} </Card>
</section> )}
</CardContent> {gpu_info.length > 0 && (
</Card> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> <CardContent className="px-1.5 py-1">
<CardContent className="px-1.5 py-1"> <section className="flex flex-col items-start gap-0.5">
<section className="flex flex-col items-start gap-0.5"> <p className="text-xs text-muted-foreground">{"GPU"}</p>
<p className="text-xs text-muted-foreground">{"GPU"}</p>
{gpu_info.length > 0 ? (
<div className="text-xs">{gpu_info.join(", ")}</div> <div className="text-xs">{gpu_info.join(", ")}</div>
) : ( </section>
<div className="text-xs"> {t("serverDetail.unknown")}</div> </CardContent>
)} </Card>
</section> )}
</CardContent>
</Card>
</section> </section>
<section className="flex flex-wrap gap-2 mt-1"> <section className="flex flex-wrap gap-2 mt-1">
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> <Card className="rounded-[10px] bg-transparent border-none shadow-none">