mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
3 Commits
14b12bf8e0
...
0c3479bb3b
Author | SHA1 | Date | |
---|---|---|---|
|
0c3479bb3b | ||
|
114a6f95eb | ||
|
682e4ccfe0 |
@ -104,7 +104,9 @@ export default function ServerDetailClient({ server_id }: { server_id: number })
|
||||
<p className="text-xs text-muted-foreground">{t("Uptime")}</p>
|
||||
<div className="text-xs">
|
||||
{" "}
|
||||
{(data?.status.Uptime / 86400).toFixed(0)} {t("Days")}{" "}
|
||||
{data?.status.Uptime / 86400 >= 1
|
||||
? (data?.status.Uptime / 86400).toFixed(0) + " " + t("Days")
|
||||
: (data?.status.Uptime / 3600).toFixed(0) + " " + t("Hours")}{" "}
|
||||
</div>
|
||||
</section>
|
||||
</CardContent>
|
||||
|
@ -23,7 +23,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
return (
|
||||
<>
|
||||
<section className="flex flex-wrap gap-2 mb-4">
|
||||
{data.asn.autonomous_system_organization && (
|
||||
{data.asn?.autonomous_system_organization && (
|
||||
<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">
|
||||
@ -33,7 +33,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.asn.autonomous_system_number && (
|
||||
{data.asn?.autonomous_system_number && (
|
||||
<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">
|
||||
@ -43,7 +43,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.registered_country?.names.en && (
|
||||
{data.city?.registered_country?.names.en && (
|
||||
<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">
|
||||
@ -53,7 +53,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.country?.iso_code && (
|
||||
{data.city?.country?.iso_code && (
|
||||
<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">
|
||||
@ -63,7 +63,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.city?.names.en && (
|
||||
{data.city?.city?.names.en && (
|
||||
<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">
|
||||
@ -73,7 +73,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.location?.longitude && (
|
||||
{data.city?.location?.longitude && (
|
||||
<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">
|
||||
@ -83,7 +83,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.location?.latitude && (
|
||||
{data.city?.location?.latitude && (
|
||||
<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">
|
||||
@ -93,7 +93,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.location?.time_zone && (
|
||||
{data.city?.location?.time_zone && (
|
||||
<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">
|
||||
@ -103,7 +103,7 @@ export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{data.city.postal && (
|
||||
{data.city?.postal && (
|
||||
<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">
|
||||
|
@ -130,34 +130,41 @@ export default function ServerCard({ serverInfo }: { serverInfo: NezhaAPISafe })
|
||||
</Card>
|
||||
</Link>
|
||||
) : (
|
||||
<Card
|
||||
className={cn(
|
||||
"flex flex-col items-center justify-start gap-3 p-3 md:px-5",
|
||||
showNetTransfer ? "lg:min-h-[91px] min-h-[123px]" : "lg:min-h-[61px] min-h-[93px]",
|
||||
{
|
||||
"flex-col": fixedTopServerName,
|
||||
"lg:flex-row": !fixedTopServerName,
|
||||
},
|
||||
)}
|
||||
>
|
||||
<section
|
||||
className={cn("grid items-center gap-2", {
|
||||
"lg:w-40": !fixedTopServerName,
|
||||
})}
|
||||
style={{ gridTemplateColumns: "auto auto 1fr" }}
|
||||
<Link onClick={saveSession} href={`/server/${id}`} prefetch={true}>
|
||||
<Card
|
||||
className={cn(
|
||||
"flex flex-col items-center justify-start gap-3 p-3 md:px-5 cursor-pointer hover:bg-accent/50 transition-colors",
|
||||
showNetTransfer ? "lg:min-h-[91px] min-h-[123px]" : "lg:min-h-[61px] min-h-[93px]",
|
||||
{
|
||||
"flex-col": fixedTopServerName,
|
||||
"lg:flex-row": !fixedTopServerName,
|
||||
},
|
||||
)}
|
||||
>
|
||||
<span className="h-2 w-2 shrink-0 rounded-full bg-red-500 self-center"></span>
|
||||
<div
|
||||
className={cn("flex items-center justify-center", showFlag ? "min-w-[17px]" : "min-w-0")}
|
||||
<section
|
||||
className={cn("grid items-center gap-2", {
|
||||
"lg:w-40": !fixedTopServerName,
|
||||
})}
|
||||
style={{ gridTemplateColumns: "auto auto 1fr" }}
|
||||
>
|
||||
{showFlag ? <ServerFlag country_code={country_code} /> : null}
|
||||
</div>
|
||||
<div className="relative">
|
||||
<p className={cn("break-all font-bold tracking-tight", showFlag ? "text-xs" : "text-sm")}>
|
||||
{name}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</Card>
|
||||
<span className="h-2 w-2 shrink-0 rounded-full bg-red-500 self-center"></span>
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-center justify-center",
|
||||
showFlag ? "min-w-[17px]" : "min-w-0",
|
||||
)}
|
||||
>
|
||||
{showFlag ? <ServerFlag country_code={country_code} /> : null}
|
||||
</div>
|
||||
<div className="relative">
|
||||
<p
|
||||
className={cn("break-all font-bold tracking-tight", showFlag ? "text-xs" : "text-sm")}
|
||||
>
|
||||
{name}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</Card>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
@ -74,6 +74,7 @@
|
||||
"Offline": "Offline",
|
||||
"Uptime": "Uptime",
|
||||
"Days": "Days",
|
||||
"Hours": "Hours",
|
||||
"Version": "Version",
|
||||
"Arch": "Arch",
|
||||
"Mem": "Mem",
|
||||
|
@ -74,6 +74,7 @@
|
||||
"Offline": "オフライン",
|
||||
"Uptime": "稼働時間",
|
||||
"Days": "日",
|
||||
"Hours": "時間",
|
||||
"Version": "バージョン",
|
||||
"Arch": "アーキテクチャ",
|
||||
"Mem": "メモリ",
|
||||
|
@ -74,6 +74,7 @@
|
||||
"Offline": "離線",
|
||||
"Uptime": "稼働時間",
|
||||
"Days": "天",
|
||||
"Hours": "小時",
|
||||
"Version": "版本",
|
||||
"Arch": "架構",
|
||||
"Mem": "記憶體",
|
||||
|
@ -74,6 +74,7 @@
|
||||
"Offline": "离线",
|
||||
"Uptime": "运行时间",
|
||||
"Days": "天",
|
||||
"Hours": "小时",
|
||||
"Version": "版本",
|
||||
"Arch": "架构",
|
||||
"Mem": "内存",
|
||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nezha-dash",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3040",
|
||||
@ -29,7 +29,7 @@
|
||||
"@turf/turf": "^7.1.0",
|
||||
"@types/d3-geo": "^3.1.0",
|
||||
"@types/luxon": "^3.4.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
||||
"caniuse-lite": "^1.0.30001690",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
@ -54,10 +54,10 @@
|
||||
"react-wrap-balancer": "^1.1.1",
|
||||
"recharts": "^2.15.0",
|
||||
"sharp": "^0.33.5",
|
||||
"swr": "^2.2.6-beta.5",
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"swr": "^2.3.0",
|
||||
"tailwind-merge": "^2.6.0",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"typescript-eslint": "^8.18.1"
|
||||
"typescript-eslint": "^8.18.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/bundle-analyzer": "^15.1.2",
|
||||
|
Loading…
Reference in New Issue
Block a user