Compare commits

..

No commits in common. "e51ec0866af20395aa46683b9e2cf8e77c7bde25" and "da3e1c7086ba8b996a6b424ae74df03adc024dc4" have entirely different histories.

4 changed files with 77 additions and 73 deletions

View File

@ -6,7 +6,7 @@
> [!CAUTION] > [!CAUTION]
> 此为 V0 兼容版本,与 V1 内置版本功能上可能有所不同 > 此为 V0 兼容版本,与 V1 内置版本功能上可能有所不同
> >
> V0 | V1 版本 issue 请在当前仓库发起 > V0 | V1 版本 issue 请在当前仓库发起
> [!TIP] > [!TIP]

View File

@ -25,7 +25,7 @@ export default function ServerDetailClient({
const [hasHistory, setHasHistory] = useState(false); const [hasHistory, setHasHistory] = useState(false);
useEffect(() => { useEffect(() => {
window.scrollTo({ top: 0, left: 0, behavior: "instant" }); window.scrollTo(0, 0);
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -120,27 +120,22 @@ export default function ServerDetailClient({
</section> </section>
</CardContent> </CardContent>
</Card> </Card>
{data?.host.Version && ( <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">{t("Version")}</p>
<p className="text-xs text-muted-foreground">{t("Version")}</p> <div className="text-xs">{data?.host.Version || "Unknown"} </div>
<div className="text-xs">{data?.host.Version} </div> </section>
</section> </CardContent>
</CardContent> </Card>
</Card> <Card className="rounded-[10px] bg-transparent border-none shadow-none">
)} <CardContent className="px-1.5 py-1">
{data?.host.Arch && ( <section className="flex flex-col items-start gap-0.5">
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> <p className="text-xs text-muted-foreground">{t("Arch")}</p>
<CardContent className="px-1.5 py-1"> <div className="text-xs">{data?.host.Arch || "Unknown"} </div>
<section className="flex flex-col items-start gap-0.5"> </section>
<p className="text-xs text-muted-foreground">{t("Arch")}</p> </CardContent>
<div className="text-xs">{data?.host.Arch} </div> </Card>
</section>
</CardContent>
</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">
@ -175,52 +170,61 @@ export default function ServerDetailClient({
</Card> </Card>
</section> </section>
<section className="flex flex-wrap gap-2 mt-1"> <section className="flex flex-wrap gap-2 mt-1">
{data?.host.Platform && ( <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">{t("System")}</p>
<p className="text-xs text-muted-foreground">{t("System")}</p> {data?.host.Platform ? (
<div className="text-xs"> <div className="text-xs">
{" "} {" "}
{data?.host.Platform} - {data?.host.PlatformVersion}{" "} {data?.host.Platform || "Unknown"} -{" "}
{data?.host.PlatformVersion}{" "}
</div> </div>
</section> ) : (
</CardContent> <div className="text-xs">Unknown</div>
</Card> )}
)} </section>
{data?.host.CPU && ( </CardContent>
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> </Card>
<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">{t("CPU")}</p> <section className="flex flex-col items-start gap-0.5">
<p className="text-xs text-muted-foreground">{t("CPU")}</p>
{data?.host.CPU ? (
<div className="text-xs"> {data?.host.CPU.join(", ")}</div> <div className="text-xs"> {data?.host.CPU.join(", ")}</div>
</section> ) : (
</CardContent> <div className="text-xs">Unknown</div>
</Card> )}
)} </section>
{data?.host.GPU && ( </CardContent>
<Card className="rounded-[10px] bg-transparent border-none shadow-none"> </Card>
<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">{"GPU"}</p> <section className="flex flex-col items-start gap-0.5">
<p className="text-xs text-muted-foreground">{"GPU"}</p>
{data?.host.GPU ? (
<div className="text-xs"> {data?.host.GPU.join(", ")}</div> <div className="text-xs"> {data?.host.GPU.join(", ")}</div>
</section> ) : (
</CardContent> <div className="text-xs">Unknown</div>
</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">
<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">{t("Load")}</p> <p className="text-xs text-muted-foreground">{t("Load")}</p>
<div className="text-xs"> {data.status.NetInTransfer ? (
{data.status.Load1.toFixed(2) || "0.00"} /{" "} <div className="text-xs">
{data.status.Load5.toFixed(2) || "0.00"} /{" "} {data.status.Load1.toFixed(2)} /{" "}
{data.status.Load15.toFixed(2) || "0.00"} {data.status.Load5.toFixed(2)} /{" "}
</div> {data.status.Load15.toFixed(2)}
</div>
) : (
<div className="text-xs">Unknown</div>
)}
</section> </section>
</CardContent> </CardContent>
</Card> </Card>

View File

@ -175,29 +175,29 @@ export default function ServerOverviewClient() {
}, },
)} )}
> >
<CardContent className="flex h-full items-center relative px-6 py-3"> <CardContent className="flex h-full items-center relative px-3 py-1 pr-0 sm:px-6 sm:py-3">
<section className="flex flex-col gap-1 w-full"> <section className="flex flex-col gap-1 w-full">
<div className="flex items-center w-full justify-between"> <div className="flex items-center w-full justify-between">
<p className="text-sm font-medium md:text-base"> <p className="text-sm font-medium md:text-base">
{t("network")} {t("network")}
</p> </p>
<section className="flex flex-row z-[999] bg-white/80 dark:bg-black/80 backdrop-blur-sm sm:items-center items-start pr-2 sm:pr-0 gap-1 ml-auto">
<p className="sm:text-[12px] text-[10px] text-nowrap font-medium">
{formatBytes(data?.total_out_bandwidth || 0)}
</p>
<p className="sm:text-[12px] text-[10px] text-nowrap font-medium">
{formatBytes(data?.total_in_bandwidth || 0)}
</p>
</section>
</div> </div>
{data?.result ? ( {data?.result ? (
<> <>
<section className="flex items-start flex-row z-[999] pr-2 sm:pr-0 gap-1"> <section className="flex flex-row mt-1.5 -mr-1 sm:items-center items-start gap-1">
<p className="sm:text-[12px] text-[10px] text-blue-800 dark:text-blue-400 text-nowrap font-medium"> <p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
{formatBytes(data?.total_out_bandwidth)} <ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1.1px]" />
</p>
<p className="sm:text-[12px] text-[10px] text-purple-800 dark:text-purple-400 text-nowrap font-medium">
{formatBytes(data?.total_in_bandwidth)}
</p>
</section>
<section className="flex flex-col sm:flex-row -mr-1 sm:items-center items-start gap-1">
<p className="text-[11px] flex items-center text-nowrap font-semibold">
<ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1px]" />
{formatBytes(data?.total_out_speed)}/s {formatBytes(data?.total_out_speed)}/s
</p> </p>
<p className="text-[11px] flex items-center text-nowrap font-semibold"> <p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
<ArrowDownCircleIcon className="size-3 mr-0.5" /> <ArrowDownCircleIcon className="size-3 mr-0.5" />
{formatBytes( {formatBytes(
data?.total_in_speed, data?.total_in_speed,
@ -206,7 +206,7 @@ export default function ServerOverviewClient() {
</section> </section>
</> </>
) : ( ) : (
<div className="flex h-[38px] items-center"> <div className="flex h-6 items-center">
<Loader visible={true} /> <Loader visible={true} />
</div> </div>
)} )}

View File

@ -1,6 +1,6 @@
{ {
"name": "nezha-dash", "name": "nezha-dash",
"version": "1.6.11", "version": "1.6.9",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3040", "dev": "next dev -p 3040",