feat: 更新仪表盘标题和描述,添加异常状态查询字段,优化管理员导航和API导出
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { getAdminPing } from "@/api";
|
||||
import { DashboardConsole } from "@/modules/dashboard/dashboard-console";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "总览",
|
||||
title: "仪表盘",
|
||||
};
|
||||
|
||||
export default async function AdminDashboardPage() {
|
||||
@@ -11,40 +12,28 @@ export default async function AdminDashboardPage() {
|
||||
const apiReady = process.env.NEXT_PUBLIC_LOTTERY_API_BASE_URL?.trim() !== "";
|
||||
|
||||
return (
|
||||
<ModuleScaffold>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<div className="rounded-xl border border-black/10 bg-white p-5 shadow-sm dark:border-white/10 dark:bg-zinc-900">
|
||||
<h2 className="text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">
|
||||
API 基底
|
||||
</h2>
|
||||
<p className="mt-2 text-sm text-foreground">
|
||||
<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="font-medium text-emerald-600 dark:text-emerald-400">
|
||||
已配置 NEXT_PUBLIC_LOTTERY_API_BASE_URL
|
||||
</span>
|
||||
<span className="ml-1 font-medium text-emerald-600 dark:text-emerald-400">已配置</span>
|
||||
) : (
|
||||
<span className="font-medium text-amber-600 dark:text-amber-400">
|
||||
未配置环境变量,无法在服务端探测 Laravel
|
||||
<span className="ml-1 font-medium text-amber-600 dark:text-amber-400">
|
||||
未配置 NEXT_PUBLIC_LOTTERY_API_BASE_URL
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
<p className="mt-3 text-xs leading-relaxed text-zinc-500 dark:text-zinc-400">
|
||||
与玩家端一致,指向 Laravel 根地址(会自动请求{" "}
|
||||
<code className="rounded bg-zinc-100 px-1 py-0.5 dark:bg-zinc-800">
|
||||
/api/v1/admin/ping
|
||||
</code>
|
||||
)。
|
||||
<p className="font-mono text-xs text-foreground">
|
||||
Admin ping(服务端无 Token 时多为空):
|
||||
{!apiReady ? "—" : ping ? JSON.stringify(ping) : "未返回"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="rounded-xl border border-black/10 bg-white p-5 shadow-sm dark:border-white/10 dark:bg-zinc-900">
|
||||
<h2 className="text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">
|
||||
Admin Ping
|
||||
</h2>
|
||||
<p className="mt-2 font-mono text-sm text-foreground">
|
||||
{!apiReady ? "—" : ping ? JSON.stringify(ping) : "请求失败或未返回信封"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</ModuleScaffold>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user