diff --git a/app/(main)/ClientComponents/ServerOverviewClient.tsx b/app/(main)/ClientComponents/ServerOverviewClient.tsx index cf370c1..2621543 100644 --- a/app/(main)/ClientComponents/ServerOverviewClient.tsx +++ b/app/(main)/ClientComponents/ServerOverviewClient.tsx @@ -7,6 +7,7 @@ import useSWR from "swr"; import { formatBytes, nezhaFetcher } from "@/lib/utils"; import { Loader } from "@/components/loading/Loader"; import { ServerApi } from "@/app/types/nezha-api"; +import MotionNumber from "motion-number"; export default function ServerOverviewClient() { const { data } = useSWR("/api/server", nezhaFetcher); @@ -24,7 +25,13 @@ export default function ServerOverviewClient() { {data ? ( -

{data?.result.length}

+
+ +
) : (
@@ -44,7 +51,13 @@ export default function ServerOverviewClient() { {data ? ( -

{data?.live_servers}

+
+ +
) : (
@@ -64,7 +77,13 @@ export default function ServerOverviewClient() { {data ? ( -

{data?.offline_servers}

+
+ +
) : (
diff --git a/bun.lockb b/bun.lockb index 639a7ae..ebc85c4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/ServerCard.tsx b/components/ServerCard.tsx index 30ea9a5..69d5643 100644 --- a/components/ServerCard.tsx +++ b/components/ServerCard.tsx @@ -9,6 +9,7 @@ import { import { cn, formatNezhaInfo } from "@/lib/utils"; import ServerCardPopover from "./ServerCardPopover"; import getUnicodeFlagIcon from "country-flag-icons/unicode"; +import MotionNumber from "motion-number"; export default function ServerCard({ serverInfo, @@ -56,26 +57,61 @@ export default function ServerCard({

CPU

-
{cpu.toFixed(2)}%
+
+ + % +

Mem

-
{mem.toFixed(2)}%
+
+ + % +

STG

-
{stg.toFixed(2)}%
+
+ + % +

Upload

-
{up.toFixed(2)}Mb/s
+
+ + Mb/s +

Download

-
{down.toFixed(2)}Mb/s
+
+ + Mb/s +
diff --git a/package.json b/package.json index f6be22c..84a0080 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev -p 3020", + "dev": "next dev -p 3020 --turbo", "start": "node .next/standalone/server.js", "lint": "next lint", "build": "next build && cp -r .next/static .next/standalone/.next/ && cp -r public .next/standalone/" @@ -26,6 +26,7 @@ "eslint-plugin-simple-import-sort": "^12.0.0", "lucide-react": "^0.414.0", "luxon": "^3.4.4", + "motion-number": "^0.1.6", "next": "^14.2.3", "next-themes": "^0.3.0", "react": "^18.2.0", @@ -54,4 +55,4 @@ "tailwindcss": "^3.4.3", "typescript": "^5.4.3" } -} +} \ No newline at end of file