diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a88193c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 仓鼠 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4d412f5..b908e04 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,6 @@ 支持部署环境: -> [!CAUTION] -> Cloudflare 部署方式暂不可用,等待 Cloudflare 官方修复。 - - Vercel - Cloudflare - Docker diff --git a/app/(main)/ClientComponents/ServerDetailClient.tsx b/app/(main)/ClientComponents/ServerDetailClient.tsx index 006e821..7f4a10b 100644 --- a/app/(main)/ClientComponents/ServerDetailClient.tsx +++ b/app/(main)/ClientComponents/ServerDetailClient.tsx @@ -9,7 +9,7 @@ import { Card, CardContent } from "@/components/ui/card"; import getEnv from "@/lib/env-entry"; import { cn, formatBytes, nezhaFetcher } from "@/lib/utils"; import { useTranslations } from "next-intl"; -import { useRouter } from "next/navigation"; +import { notFound, useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import useSWR from "swr"; import useSWRImmutable from "swr/immutable"; @@ -51,6 +51,10 @@ export default function ServerDetailClient({ (item) => item.id === server_id, ); + if (!fallbackData) { + notFound(); + } + const { data, error } = useSWR( `/api/detail?server_id=${server_id}`, nezhaFetcher, diff --git a/app/(main)/[id]/page.tsx b/app/(main)/server/[id]/page.tsx similarity index 100% rename from app/(main)/[id]/page.tsx rename to app/(main)/server/[id]/page.tsx diff --git a/app/not-found.tsx b/app/not-found.tsx index 237a1e0..af69320 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -1,33 +1,27 @@ import { useTranslations } from "next-intl"; -import Image from "next/image"; import Link from "next/link"; export const runtime = "edge"; +import Footer from "./(main)/footer"; +import Header from "./(main)/header"; + export default function NotFoundPage() { const t = useTranslations("NotFoundPage"); return ( -
-
- TARDIS -
-

- {t("h1_490-590_404NotFound")} -

-

- {t("p_601-665_TARDISERROR")} -

- - {t("Link_676-775_Doctor")} +
+
+
+
+

{t("h1_490-590_404NotFound")}

+ +

+ {t("h1_490-590_404NotFoundBack")} +

-
-
-
+ +