diff --git a/app/(main)/ClientComponents/NetworkChart.tsx b/app/(main)/ClientComponents/detail/NetworkChart.tsx similarity index 99% rename from app/(main)/ClientComponents/NetworkChart.tsx rename to app/(main)/ClientComponents/detail/NetworkChart.tsx index 0760ce6af..083a98d64 100644 --- a/app/(main)/ClientComponents/NetworkChart.tsx +++ b/app/(main)/ClientComponents/detail/NetworkChart.tsx @@ -1,7 +1,7 @@ "use client" -import NetworkChartLoading from "@/app/(main)/ClientComponents/NetworkChartLoading" import { NezhaAPIMonitor, ServerMonitorChart } from "@/app/types/nezha-api" +import NetworkChartLoading from "@/components/loading/NetworkChartLoading" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { ChartConfig, diff --git a/app/(main)/ClientComponents/ServerDetailChartClient.tsx b/app/(main)/ClientComponents/detail/ServerDetailChartClient.tsx similarity index 99% rename from app/(main)/ClientComponents/ServerDetailChartClient.tsx rename to app/(main)/ClientComponents/detail/ServerDetailChartClient.tsx index b2357b6de..f3aa06b0f 100644 --- a/app/(main)/ClientComponents/ServerDetailChartClient.tsx +++ b/app/(main)/ClientComponents/detail/ServerDetailChartClient.tsx @@ -1,7 +1,7 @@ "use client" -import { ServerDetailChartLoading } from "@/app/(main)/ClientComponents/ServerDetailLoading" import { NezhaAPISafe, ServerApi } from "@/app/types/nezha-api" +import { ServerDetailChartLoading } from "@/components/loading/ServerDetailLoading" import AnimatedCircularProgressBar from "@/components/ui/animated-circular-progress-bar" import { Card, CardContent } from "@/components/ui/card" import { ChartConfig, ChartContainer } from "@/components/ui/chart" diff --git a/app/(main)/ClientComponents/ServerDetailClient.tsx b/app/(main)/ClientComponents/detail/ServerDetailClient.tsx similarity index 99% rename from app/(main)/ClientComponents/ServerDetailClient.tsx rename to app/(main)/ClientComponents/detail/ServerDetailClient.tsx index 06e65a082..62f79d164 100644 --- a/app/(main)/ClientComponents/ServerDetailClient.tsx +++ b/app/(main)/ClientComponents/detail/ServerDetailClient.tsx @@ -1,9 +1,9 @@ "use client" -import { ServerDetailLoading } from "@/app/(main)/ClientComponents/ServerDetailLoading" import { NezhaAPISafe, ServerApi } from "@/app/types/nezha-api" import { BackIcon } from "@/components/Icon" import ServerFlag from "@/components/ServerFlag" +import { ServerDetailLoading } from "@/components/loading/ServerDetailLoading" import { Badge } from "@/components/ui/badge" import { Card, CardContent } from "@/components/ui/card" import getEnv from "@/lib/env-entry" diff --git a/app/(main)/ClientComponents/ServerIPInfo.tsx b/app/(main)/ClientComponents/detail/ServerIPInfo.tsx similarity index 100% rename from app/(main)/ClientComponents/ServerIPInfo.tsx rename to app/(main)/ClientComponents/detail/ServerIPInfo.tsx diff --git a/app/(main)/ClientComponents/TooltipContext.tsx b/app/(main)/ClientComponents/detail/TooltipContext.tsx similarity index 100% rename from app/(main)/ClientComponents/TooltipContext.tsx rename to app/(main)/ClientComponents/detail/TooltipContext.tsx diff --git a/app/(main)/ClientComponents/Global.tsx b/app/(main)/ClientComponents/main/Global.tsx similarity index 89% rename from app/(main)/ClientComponents/Global.tsx rename to app/(main)/ClientComponents/main/Global.tsx index c14fbb6f7..8e5fb3125 100644 --- a/app/(main)/ClientComponents/Global.tsx +++ b/app/(main)/ClientComponents/main/Global.tsx @@ -4,11 +4,11 @@ import { ServerApi } from "@/app/types/nezha-api" import { nezhaFetcher } from "@/lib/utils" import useSWRImmutable from "swr/immutable" -import { geoJsonString } from "../../../lib/geo-json-string" +import GlobalLoading from "../../../../components/loading/GlobalLoading" +import { geoJsonString } from "../../../../lib/geo-json-string" +import { TooltipProvider } from "../detail/TooltipContext" import GlobalInfo from "./GlobalInfo" -import GlobalLoading from "./GlobalLoading" import { InteractiveMap } from "./InteractiveMap" -import { TooltipProvider } from "./TooltipContext" export default function ServerGlobal() { const { data: nezhaServerList, error } = useSWRImmutable("/api/server", nezhaFetcher) diff --git a/app/(main)/ClientComponents/GlobalInfo.tsx b/app/(main)/ClientComponents/main/GlobalInfo.tsx similarity index 100% rename from app/(main)/ClientComponents/GlobalInfo.tsx rename to app/(main)/ClientComponents/main/GlobalInfo.tsx diff --git a/app/(main)/ClientComponents/InteractiveMap.tsx b/app/(main)/ClientComponents/main/InteractiveMap.tsx similarity index 98% rename from app/(main)/ClientComponents/InteractiveMap.tsx rename to app/(main)/ClientComponents/main/InteractiveMap.tsx index 99598dd12..84b176907 100644 --- a/app/(main)/ClientComponents/InteractiveMap.tsx +++ b/app/(main)/ClientComponents/main/InteractiveMap.tsx @@ -3,8 +3,8 @@ import { countryCoordinates } from "@/lib/geo-limit" import { geoEquirectangular, geoPath } from "d3-geo" +import { useTooltip } from "../detail/TooltipContext" import MapTooltip from "./MapTooltip" -import { useTooltip } from "./TooltipContext" interface InteractiveMapProps { countries: string[] diff --git a/app/(main)/ClientComponents/MapTooltip.tsx b/app/(main)/ClientComponents/main/MapTooltip.tsx similarity index 97% rename from app/(main)/ClientComponents/MapTooltip.tsx rename to app/(main)/ClientComponents/main/MapTooltip.tsx index 8f7d40888..b684d27cd 100644 --- a/app/(main)/ClientComponents/MapTooltip.tsx +++ b/app/(main)/ClientComponents/main/MapTooltip.tsx @@ -4,7 +4,7 @@ import { AnimatePresence, m } from "framer-motion" import { useTranslations } from "next-intl" import { memo } from "react" -import { useTooltip } from "./TooltipContext" +import { useTooltip } from "../detail/TooltipContext" const MapTooltip = memo(function MapTooltip() { const { tooltipData } = useTooltip() diff --git a/app/(main)/ClientComponents/ServerListClient.tsx b/app/(main)/ClientComponents/main/ServerListClient.tsx similarity index 98% rename from app/(main)/ClientComponents/ServerListClient.tsx rename to app/(main)/ClientComponents/main/ServerListClient.tsx index 02e5506d7..46e0efbff 100644 --- a/app/(main)/ClientComponents/ServerListClient.tsx +++ b/app/(main)/ClientComponents/main/ServerListClient.tsx @@ -14,7 +14,7 @@ import dynamic from "next/dynamic" import { useEffect, useRef, useState } from "react" import useSWR from "swr" -import GlobalLoading from "./GlobalLoading" +import GlobalLoading from "../../../../components/loading/GlobalLoading" const ServerGlobal = dynamic(() => import("./Global"), { ssr: false, diff --git a/app/(main)/ClientComponents/ServerOverviewClient.tsx b/app/(main)/ClientComponents/main/ServerOverviewClient.tsx similarity index 99% rename from app/(main)/ClientComponents/ServerOverviewClient.tsx rename to app/(main)/ClientComponents/main/ServerOverviewClient.tsx index d32b31e77..48c244b72 100644 --- a/app/(main)/ClientComponents/ServerOverviewClient.tsx +++ b/app/(main)/ClientComponents/main/ServerOverviewClient.tsx @@ -141,7 +141,7 @@ export default function ServerOverviewClient() { {data?.result ? ( <> -
+

↑{formatBytes(data?.total_out_bandwidth)}

@@ -168,7 +168,7 @@ export default function ServerOverviewClient() {
{!disableCartoon && ( {"Hamster1963"} - - + + ) } diff --git a/app/(main)/server/[id]/page.tsx b/app/(main)/server/[id]/page.tsx index 94fecf41d..ad3a6b842 100644 --- a/app/(main)/server/[id]/page.tsx +++ b/app/(main)/server/[id]/page.tsx @@ -1,14 +1,14 @@ "use client" -import { NetworkChartClient } from "@/app/(main)/ClientComponents/NetworkChart" -import ServerDetailChartClient from "@/app/(main)/ClientComponents/ServerDetailChartClient" -import ServerDetailClient from "@/app/(main)/ClientComponents/ServerDetailClient" +import { NetworkChartClient } from "@/app/(main)/ClientComponents/detail/NetworkChart" +import ServerDetailChartClient from "@/app/(main)/ClientComponents/detail/ServerDetailChartClient" +import ServerDetailClient from "@/app/(main)/ClientComponents/detail/ServerDetailClient" import TabSwitch from "@/components/TabSwitch" import { Separator } from "@/components/ui/separator" import getEnv from "@/lib/env-entry" import { use, useState } from "react" -import ServerIPInfo from "../../ClientComponents/ServerIPInfo" +import ServerIPInfo from "../../ClientComponents/detail/ServerIPInfo" export default function Page(props: { params: Promise<{ id: string }> }) { const params = use(props.params) diff --git a/app/not-found.tsx b/app/not-found.tsx index 2d057916b..a4db54b1e 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -10,7 +10,7 @@ export default function NotFoundPage() {
-
+

{t("h1_490-590_404NotFound")}

{t("h1_490-590_404NotFoundBack")}

diff --git a/bun.lockb b/bun.lockb index 3278b7fb5..6ca7f0ea6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/BlurLayer.tsx b/components/BlurLayer.tsx deleted file mode 100644 index 1c52275ff..000000000 --- a/components/BlurLayer.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from "react" - -const BlurLayers = () => { - const computeLayerStyle = (index: number) => { - const blurAmount = index * 3.7037 - const maskStart = index * 10 - let maskEnd = maskStart + 20 - if (maskEnd > 100) { - maskEnd = 100 - } - return { - backdropFilter: `blur-sm(${blurAmount}px)`, - WebkitBackdropFilter: `blur-sm(${blurAmount}px)`, - zIndex: index + 1, - maskImage: `linear-gradient(rgba(0, 0, 0, 0) ${maskStart}%, rgb(0, 0, 0) ${maskEnd}%)`, - } - } - - // 根据层数动态生成层 - const layers = Array.from({ length: 5 }).map((_, index) => ( -
- )) - - return ( -
-
{layers}
-
- ) -} - -export default BlurLayers diff --git a/components/ServerList.tsx b/components/ServerList.tsx deleted file mode 100644 index fd28224ec..000000000 --- a/components/ServerList.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import ServerListClient from "@/app/(main)/ClientComponents/ServerListClient" - -export default async function ServerList() { - return -} diff --git a/components/ServerOverview.tsx b/components/ServerOverview.tsx deleted file mode 100644 index 79814e69f..000000000 --- a/components/ServerOverview.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import ServerOverviewClient from "@/app/(main)/ClientComponents/ServerOverviewClient" - -export default async function ServerOverview() { - return -} diff --git a/app/(main)/ClientComponents/GlobalLoading.tsx b/components/loading/GlobalLoading.tsx similarity index 100% rename from app/(main)/ClientComponents/GlobalLoading.tsx rename to components/loading/GlobalLoading.tsx diff --git a/app/(main)/ClientComponents/NetworkChartLoading.tsx b/components/loading/NetworkChartLoading.tsx similarity index 100% rename from app/(main)/ClientComponents/NetworkChartLoading.tsx rename to components/loading/NetworkChartLoading.tsx diff --git a/app/(main)/ClientComponents/ServerDetailLoading.tsx b/components/loading/ServerDetailLoading.tsx similarity index 100% rename from app/(main)/ClientComponents/ServerDetailLoading.tsx rename to components/loading/ServerDetailLoading.tsx diff --git a/package.json b/package.json index 5c1fc4f71..c6031819d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nezha-dash", - "version": "1.8.1", + "version": "1.8.2", "private": true, "scripts": { "dev": "next dev -p 3040", @@ -17,8 +17,8 @@ "@heroicons/react": "^2.2.0", "@radix-ui/react-dialog": "^1.1.3", "@radix-ui/react-dropdown-menu": "^2.1.3", - "@radix-ui/react-label": "^2.1.0", - "@radix-ui/react-navigation-menu": "^1.2.1", + "@radix-ui/react-label": "^2.1.1", + "@radix-ui/react-navigation-menu": "^1.2.2", "@radix-ui/react-popover": "^1.1.3", "@radix-ui/react-progress": "^1.1.1", "@radix-ui/react-separator": "^1.1.1", @@ -50,7 +50,7 @@ "react": "^19.0.0", "react-device-detect": "^2.2.3", "react-dom": "^19.0.0", - "react-intersection-observer": "^9.13.1", + "react-intersection-observer": "^9.14.0", "react-wrap-balancer": "^1.1.1", "recharts": "^2.15.0", "sharp": "^0.33.5", @@ -61,18 +61,18 @@ }, "devDependencies": { "@next/bundle-analyzer": "^15.1.0", - "@tailwindcss/postcss": "^4.0.0-beta.6", + "@tailwindcss/postcss": "^4.0.0-beta.7", "@types/node": "^22.10.2", "@types/react": "^19.0.1", "@types/react-dom": "^19.0.2", - "eslint": "^9.16.0", + "eslint": "^9.17.0", "eslint-config-next": "^15.1.0", "eslint-plugin-turbo": "^2.3.3", "eslint-plugin-unused-imports": "^4.1.4", "postcss": "^8.4.49", "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.9", - "tailwindcss": "^4.0.0-beta.6", + "tailwindcss": "^4.0.0-beta.7", "typescript": "^5.7.2", "vercel": "^39.2.2" },