Compare commits

..

5 Commits

Author SHA1 Message Date
hamster1963
e51ec0866a v1.6.11 2024-12-04 18:06:43 +08:00
hamster1963
310e7d4338 style: network display 2024-12-04 18:06:28 +08:00
hamster1963
8042edaeff fix: scroll behavior 2024-12-04 17:50:16 +08:00
hamster1963
b21e9d12d5 v1.6.10 2024-12-04 14:38:23 +08:00
hamster1963
89adcd98da style: hide unknown field 2024-12-04 14:37:53 +08:00
4 changed files with 73 additions and 77 deletions

View File

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

View File

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

View File

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

View File

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