mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge branch 'hamster1963:main' into main
This commit is contained in:
commit
221f00527f
11
README.md
11
README.md
@ -5,13 +5,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
一键部署到 Vercel
|
||||
### 一键部署到 Vercel
|
||||
[部署简易教程](https://buycoffee.top/blog/tech/nezha)
|
||||
<br>
|
||||
<br>
|
||||
填入 nezha 地址 (例如:http://120.5.4.32:8008) 与 token
|
||||
|
||||

|
||||
|
||||
[](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)
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||

|
||||
|
@ -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<ServerApi>('/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}
|
||||
|
Loading…
Reference in New Issue
Block a user