Merge branch 'main' into cloudflare

This commit is contained in:
hamster1963 2024-10-24 14:37:01 +08:00
commit 06015baf50
4 changed files with 4 additions and 7 deletions

View File

@ -9,9 +9,8 @@ export const runtime = 'edge';
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
interface NezhaDataResponse { interface NezhaDataResponse extends NezhaAPISafe {
error?: string; error?: string;
data?: NezhaAPISafe;
cause?: string; cause?: string;
code?: string; code?: string;
} }

View File

@ -11,7 +11,6 @@ export const dynamic = "force-dynamic";
interface NezhaDataResponse { interface NezhaDataResponse {
error?: string; error?: string;
data?: ServerMonitorChart;
cause?: string; cause?: string;
code?: string; code?: string;
} }

View File

@ -9,9 +9,8 @@ export const dynamic = "force-dynamic";
export const runtime = "edge"; export const runtime = "edge";
interface NezhaDataResponse { interface NezhaDataResponse extends ServerApi{
error?: string; error?: string;
data?: ServerApi;
cause?: string; cause?: string;
code?: string; code?: string;
} }
@ -39,7 +38,7 @@ export const GET = auth(async function GET(req) {
{ status: 400 }, { status: 400 },
); );
} }
if (!response.data) { if (!response.result) {
return NextResponse.json({ cause: "fetch data empty" }, { status: 400 }); return NextResponse.json({ cause: "fetch data empty" }, { status: 400 });
} }
return NextResponse.json(response, { status: 200 }); return NextResponse.json(response, { status: 200 });

View File

@ -1,6 +1,6 @@
{ {
"name": "nezha-dash", "name": "nezha-dash",
"version": "0.7.3", "version": "0.7.5",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3020", "dev": "next dev -p 3020",