diff --git a/app/api/server-ip/route.ts b/app/api/server-ip/route.ts index 8f9a781..92e49d4 100644 --- a/app/api/server-ip/route.ts +++ b/app/api/server-ip/route.ts @@ -28,7 +28,7 @@ export async function GET(req: NextRequest) { } if (!getEnv("NEXT_PUBLIC_ShowIpInfo")) { - return NextResponse.json({ error: "NEXT_PUBLIC_ShowIpInfo is disable" }, { status: 400 }) + return NextResponse.json({ error: "ip info is disabled" }, { status: 400 }) } const { searchParams } = new URL(req.url) diff --git a/lib/serverFetch.tsx b/lib/serverFetch.tsx index 2017d67..d779a72 100644 --- a/lib/serverFetch.tsx +++ b/lib/serverFetch.tsx @@ -3,10 +3,10 @@ import type { NezhaAPI, ServerApi } from "@/app/types/nezha-api" import type { MakeOptional } from "@/app/types/utils" import getEnv from "@/lib/env-entry" -import { unstable_noStore as noStore } from "next/cache" +import { connection } from 'next/server' export async function GetNezhaData() { - noStore() + await connection() let nezhaBaseUrl = getEnv("NezhaBaseUrl") if (!nezhaBaseUrl) { @@ -87,6 +87,8 @@ export async function GetNezhaData() { } export async function GetServerMonitor({ server_id }: { server_id: number }) { + await connection() + let nezhaBaseUrl = getEnv("NezhaBaseUrl") if (!nezhaBaseUrl) { console.error("NezhaBaseUrl is not set") @@ -131,6 +133,8 @@ export async function GetServerIP({ }: { server_id: number }): Promise { + await connection() + let nezhaBaseUrl = getEnv("NezhaBaseUrl") if (!nezhaBaseUrl) { console.error("NezhaBaseUrl is not set") @@ -178,6 +182,7 @@ export async function GetServerIP({ } export async function GetServerDetail({ server_id }: { server_id: number }) { + await connection() let nezhaBaseUrl = getEnv("NezhaBaseUrl") if (!nezhaBaseUrl) { console.error("NezhaBaseUrl is not set") diff --git a/next.config.mjs b/next.config.mjs index 201e29e..61934f2 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,7 +1,6 @@ import withPWAInit from "@ducanh2912/next-pwa" import withBundleAnalyzer from "@next/bundle-analyzer" import createNextIntlPlugin from "next-intl/plugin" -import { env } from "next-runtime-env" const bundleAnalyzer = withBundleAnalyzer({ enabled: process.env.ANALYZE === "true", @@ -29,7 +28,6 @@ const nextConfig = { }, }, output: "standalone", - poweredByHeader: false, eslint: { // Warning: This allows production builds to successfully complete even if // your project has ESLint errors.