diff --git a/README.md b/README.md index 9ede992..ed1f032 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,14 @@ -一键部署到 Vercel +### 一键部署到 Vercel +[部署简易教程](https://buycoffee.top/blog/tech/nezha) +

-填入 nezha 地址 (例如:http://120.5.4.32:8008) 与 token - -![get-token](/.github/get-token.png) - [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhamster1963%2Fnezha-dash&env=NezhaBaseUrl,NezhaAuth&project-name=nezha-dash&repository-name=nezha-dash) + + + ![screen-shot-one](/.github/shotOne.png) ![screen-shot-two](/.github/shotTwo.png) diff --git a/app/(main)/ClientComponents/ServerListClient.tsx b/app/(main)/ClientComponents/ServerListClient.tsx index a38ab4d..97493c2 100644 --- a/app/(main)/ClientComponents/ServerListClient.tsx +++ b/app/(main)/ClientComponents/ServerListClient.tsx @@ -4,6 +4,7 @@ import { ServerApi } from "@/app/types/nezha-api"; import ServerCard from "@/components/ServerCard"; import { nezhaFetcher } from "@/lib/utils"; import useSWR from "swr"; +import { DateTime } from "luxon"; export default function ServerListClient() { const { data } = useSWR('/api/server', nezhaFetcher, { @@ -23,7 +24,7 @@ export default function ServerListClient() { name={server.name} up={server.status.NetOutSpeed / 1024 / 1024} down={server.status.NetInSpeed / 1024 / 1024} - status={server.status.Uptime !== 0 ? "online" : "offline"} + status={DateTime.now().toUnixInteger() - server.last_active > 300 ? "offline" : "online"} uptime={server.status.Uptime / 86400} mem={(server.status.MemUsed / server.host.MemTotal) * 100} stg={server.status.DiskUsed / server.host.DiskTotal}