refactor: 移除冗余注释和描述,优化管理员模块的代码结构
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { getAdminPing } from "@/api";
|
||||
import { DashboardConsole } from "@/modules/dashboard/dashboard-console";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
@@ -7,33 +6,10 @@ export const metadata: Metadata = {
|
||||
title: "仪表盘",
|
||||
};
|
||||
|
||||
export default async function AdminDashboardPage() {
|
||||
const ping = await getAdminPing();
|
||||
const apiReady = process.env.NEXT_PUBLIC_LOTTERY_API_BASE_URL?.trim() !== "";
|
||||
|
||||
export default function AdminDashboardPage() {
|
||||
return (
|
||||
<ModuleScaffold className="max-w-7xl">
|
||||
<DashboardConsole />
|
||||
|
||||
<details className="mt-8 rounded-lg border border-border/80 bg-muted/30 px-4 py-3 text-sm">
|
||||
<summary className="cursor-pointer font-medium text-muted-foreground">API 连通性(调试)</summary>
|
||||
<div className="mt-3 grid gap-3 sm:grid-cols-2">
|
||||
<p className="text-muted-foreground">
|
||||
基底:
|
||||
{apiReady ? (
|
||||
<span className="ml-1 font-medium text-emerald-600 dark:text-emerald-400">已配置</span>
|
||||
) : (
|
||||
<span className="ml-1 font-medium text-amber-600 dark:text-amber-400">
|
||||
未配置 NEXT_PUBLIC_LOTTERY_API_BASE_URL
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
<p className="font-mono text-xs text-foreground">
|
||||
Admin ping(服务端无 Token 时多为空):
|
||||
{!apiReady ? "—" : ping ? JSON.stringify(ping) : "未返回"}
|
||||
</p>
|
||||
</div>
|
||||
</details>
|
||||
</ModuleScaffold>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user