mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
perf: remove motion-number
This commit is contained in:
parent
51800e11c1
commit
427a05a6e2
@ -7,7 +7,6 @@ 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<ServerApi>("/api/server", nezhaFetcher);
|
||||
@ -26,11 +25,7 @@ export default function ServerOverviewClient() {
|
||||
</span>
|
||||
{data ? (
|
||||
<div className="text-lg font-semibold">
|
||||
<MotionNumber
|
||||
value={data?.result.length}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{data?.result.length}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex h-7 items-center">
|
||||
@ -52,11 +47,7 @@ export default function ServerOverviewClient() {
|
||||
</span>
|
||||
{data ? (
|
||||
<div className="text-lg font-semibold">
|
||||
<MotionNumber
|
||||
value={data?.live_servers}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{data?.live_servers}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex h-7 items-center">
|
||||
@ -78,11 +69,7 @@ export default function ServerOverviewClient() {
|
||||
</span>
|
||||
{data ? (
|
||||
<div className="text-lg font-semibold">
|
||||
<MotionNumber
|
||||
value={data?.offline_servers}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{data?.offline_servers}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex h-7 items-center">
|
||||
|
@ -9,7 +9,6 @@ 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,
|
||||
@ -58,11 +57,7 @@ export default function ServerCard({
|
||||
<div className={"flex flex-col"}>
|
||||
<p className="text-xs text-muted-foreground">CPU</p>
|
||||
<div className="text-xs font-semibold flex items-center">
|
||||
<MotionNumber
|
||||
value={cpu.toFixed(2)}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{cpu.toFixed(2)}
|
||||
%
|
||||
</div>
|
||||
<ServerUsageBar value={cpu} />
|
||||
@ -70,11 +65,7 @@ export default function ServerCard({
|
||||
<div className={"flex flex-col"}>
|
||||
<p className="text-xs text-muted-foreground">Mem</p>
|
||||
<div className="text-xs font-semibold flex items-center">
|
||||
<MotionNumber
|
||||
value={mem.toFixed(2)}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{mem.toFixed(2)}
|
||||
%
|
||||
</div>
|
||||
<ServerUsageBar value={mem} />
|
||||
@ -82,34 +73,22 @@ export default function ServerCard({
|
||||
<div className={"flex flex-col"}>
|
||||
<p className="text-xs text-muted-foreground">STG</p>
|
||||
<div className="text-xs font-semibold flex items-center">
|
||||
<MotionNumber
|
||||
value={stg.toFixed(2)}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
{stg.toFixed(2)}
|
||||
%
|
||||
</div>
|
||||
<ServerUsageBar value={stg} />
|
||||
</div>
|
||||
<div className={"flex flex-col items-end"}>
|
||||
<div className={"flex flex-col"}>
|
||||
<p className="text-xs text-muted-foreground">Upload</p>
|
||||
<div className="text-xs font-semibold flex items-center justify-end">
|
||||
<MotionNumber
|
||||
value={up.toFixed(2)}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
<div className="text-xs font-semibold flex items-center">
|
||||
{up.toFixed(2)}
|
||||
Mb/s
|
||||
</div>
|
||||
</div>
|
||||
<div className={"flex flex-col"}>
|
||||
<p className="text-xs text-muted-foreground">Download</p>
|
||||
<div className="text-xs font-semibold flex items-center justify-end">
|
||||
<MotionNumber
|
||||
value={down.toFixed(2)}
|
||||
format={{ notation: "compact" }}
|
||||
locales="en-US"
|
||||
/>
|
||||
<div className="text-xs font-semibold flex items-center">
|
||||
{down.toFixed(2)}
|
||||
Mb/s
|
||||
</div>
|
||||
</div>
|
||||
|
@ -26,7 +26,6 @@
|
||||
"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",
|
||||
|
Loading…
Reference in New Issue
Block a user