mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
5 Commits
da3e1c7086
...
e51ec0866a
Author | SHA1 | Date | |
---|---|---|---|
|
e51ec0866a | ||
|
310e7d4338 | ||
|
8042edaeff | ||
|
b21e9d12d5 | ||
|
89adcd98da |
@ -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>
|
||||
{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 || "Unknown"} </div>
|
||||
<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 || "Unknown"} </div>
|
||||
<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">
|
||||
{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>
|
||||
{data?.host.Platform ? (
|
||||
|
||||
<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>
|
||||
)}
|
||||
{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>
|
||||
{data?.host.CPU ? (
|
||||
|
||||
<div className="text-xs"> {data?.host.CPU.join(", ")}</div>
|
||||
) : (
|
||||
<div className="text-xs">Unknown</div>
|
||||
)}
|
||||
</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>
|
||||
{data?.host.GPU ? (
|
||||
<div className="text-xs"> {data?.host.GPU.join(", ")}</div>
|
||||
) : (
|
||||
<div className="text-xs">Unknown</div>
|
||||
)}
|
||||
</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)}
|
||||
{data.status.Load1.toFixed(2) || "0.00"} /{" "}
|
||||
{data.status.Load5.toFixed(2) || "0.00"} /{" "}
|
||||
{data.status.Load15.toFixed(2) || "0.00"}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-xs">Unknown</div>
|
||||
)}
|
||||
</section>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
@ -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>
|
||||
)}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nezha-dash",
|
||||
"version": "1.6.9",
|
||||
"version": "1.6.11",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3040",
|
||||
|
Loading…
Reference in New Issue
Block a user