调整宽度, 调整tag

This commit is contained in:
wood chen 2025-03-10 16:42:51 +08:00
parent f04c220570
commit 7b5495997f
7 changed files with 119 additions and 114 deletions

View File

@ -15,7 +15,7 @@ const Footer: React.FC = () => {
})
return (
<footer className="mx-auto w-full max-w-screen-xl px-4 lg:px-0 pb-4 server-footer">
<footer className="mx-auto w-full max-w-6xl px-4 lg:px-0 pb-4 server-footer">
<section className="flex flex-col">
<section className="mt-1 flex items-center sm:flex-row flex-col justify-between gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50 server-footer-name">
<div className="flex items-center gap-1">

View File

@ -76,7 +76,7 @@ function Header() {
const customBackgroundImage = backgroundImage
return (
<div className="mx-auto w-full max-w-screen-xl">
<div className="mx-auto w-full max-w-6xl">
<section className="flex items-center justify-between header-top">
<section
onClick={() => {

View File

@ -162,14 +162,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
</div>
</section>
{/* 服务器详细信息标签 */}
{/* 服务器详细信息标签和 PlanInfo */}
<section className="flex items-center gap-1.5 w-full mt-1">
{showServerDetails && (
<section className="flex flex-wrap items-center gap-1 w-full mt-1">
<>
{cpu_info && cpu_info.length > 0 && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<p className={cn("text-[9px] bg-blue-600 dark:bg-blue-800 text-blue-200 dark:text-blue-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{cpu_info[0].includes("Physical") ? "物理CPU: " : "vCPU: "}
{cpu_info[0].match(/(\d+)\s+(?:Physical|Virtual)\s+Core/)?.[1] || "?"}
</p>
@ -182,43 +183,46 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
)}
{mem_total > 0 && (
<p className={cn("text-[9px] bg-green-600 text-green-200 dark:bg-green-800 dark:text-green-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverCard.mem")}: {formatBytes(mem_total)}
</p>
)}
{disk_total > 0 && (
<p className={cn("text-[9px] bg-purple-600 text-purple-200 dark:bg-purple-800 dark:text-purple-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverCard.stg")}: {formatBytes(disk_total)}
</p>
)}
{tcp > 0 && (
<p className={cn("text-[9px] bg-pink-600 text-pink-200 dark:bg-pink-800 dark:text-pink-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
TCP: {tcp}
</p>
)}
{udp > 0 && (
<p className={cn("text-[9px] bg-orange-600 text-orange-200 dark:bg-orange-800 dark:text-orange-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
UDP: {udp}
</p>
)}
{process > 0 && (
<p className={cn("text-[9px] bg-yellow-600 text-yellow-200 dark:bg-yellow-800 dark:text-yellow-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverDetailChart.process")}: {process}
</p>
)}
{uptime > 0 && (
<p className={cn("text-[9px] bg-stone-600 text-stone-200 dark:bg-stone-800 dark:text-stone-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverCard.uptime")}: {formatUptime(uptime)}
</p>
)}
</section>
</>
)}
{parsedData?.planDataMod && <PlanInfo parsedData={parsedData} />}
</section>
{showNetTransfer && (
<section className={"flex items-center w-full justify-between gap-1"}>
<Badge
@ -235,7 +239,6 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
</Badge>
</section>
)}
{parsedData?.planDataMod && <PlanInfo parsedData={parsedData} />}
</div>
</Card>
) : (

View File

@ -137,14 +137,15 @@ export default function ServerCardInline({ now, serverInfo }: { now: number; ser
</div>
</section>
{/* 服务器详细信息标签 */}
{/* 服务器详细信息标签和 PlanInfo */}
<section className="flex items-center gap-1.5 w-full mt-1">
{showServerDetails && (
<section className="flex flex-wrap items-center gap-1 w-full mt-1">
<>
{cpu_info && cpu_info.length > 0 && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<p className={cn("text-[9px] bg-blue-600 dark:bg-blue-800 text-blue-200 dark:text-blue-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{cpu_info[0].includes("Physical") ? "物理CPU: " : "vCPU: "}
{cpu_info[0].match(/(\d+)\s+(?:Physical|Virtual)\s+Core/)?.[1] || "?"}
</p>
@ -157,38 +158,39 @@ export default function ServerCardInline({ now, serverInfo }: { now: number; ser
)}
{mem_total > 0 && (
<p className={cn("text-[9px] bg-green-600 text-green-200 dark:bg-green-800 dark:text-green-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverCard.mem")}: {formatBytes(mem_total)}
</p>
)}
{disk_total > 0 && (
<p className={cn("text-[9px] bg-purple-600 text-purple-200 dark:bg-purple-800 dark:text-purple-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverCard.stg")}: {formatBytes(disk_total)}
</p>
)}
{tcp > 0 && (
<p className={cn("text-[9px] bg-pink-600 text-pink-200 dark:bg-pink-800 dark:text-pink-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
TCP: {tcp}
</p>
)}
{udp > 0 && (
<p className={cn("text-[9px] bg-orange-600 text-orange-200 dark:bg-orange-800 dark:text-orange-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
UDP: {udp}
</p>
)}
{process > 0 && (
<p className={cn("text-[9px] bg-yellow-600 text-yellow-200 dark:bg-yellow-800 dark:text-yellow-300 w-fit rounded-[5px] px-[3px] py-[1.5px]")}>
<p className={cn("text-[10px] text-muted-foreground")}>
{t("serverDetailChart.process")}: {process}
</p>
)}
</section>
</>
)}
{parsedData?.planDataMod && <PlanInfo parsedData={parsedData} />}
</section>
</div>
</Card>
</section>

View File

@ -22,7 +22,7 @@ export function ServerDetailLoading() {
const navigate = useNavigate()
return (
<div className="mx-auto w-full max-w-screen-xl px-0">
<div className="mx-auto w-full max-w-6xl px-0">
<div
onClick={() => {
navigate("/")

View File

@ -211,7 +211,7 @@ export default function Servers() {
})
return (
<div className="mx-auto w-full max-w-screen-xl px-0">
<div className="mx-auto w-full max-w-6xl px-0">
<ServerOverview
total={totalServers}
online={onlineServers}

View File

@ -24,7 +24,7 @@ export default function ServerDetail() {
}
return (
<div className="mx-auto w-full max-w-screen-xl px-0 flex flex-col gap-4 server-info">
<div className="mx-auto w-full max-w-6xl px-0 flex flex-col gap-4 server-info">
<ServerDetailOverview server_id={server_id} />
<section className="flex items-center my-2 w-full">
<Separator className="flex-1" />