feat(config): 重构配置中心导航与版本展示,支持全量版本加载
This commit is contained in:
@@ -1,64 +1,11 @@
|
||||
import Link from "next/link";
|
||||
import { Layers, Shield, Wrench } from "lucide-react";
|
||||
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { CONFIG_NAV_GROUPS } from "@/modules/config/config-nav-model";
|
||||
import { configHubMeta } from "@/modules/config/meta";
|
||||
import { redirect } from "next/navigation";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: configHubMeta.title,
|
||||
};
|
||||
|
||||
const GROUP_ICONS = {
|
||||
betting: Layers,
|
||||
risk_wallet: Shield,
|
||||
ops: Wrench,
|
||||
} as const;
|
||||
|
||||
export default function AdminConfigHubPage() {
|
||||
return (
|
||||
<ModuleScaffold className="max-w-4xl">
|
||||
<header className="mb-8 space-y-2">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">{configHubMeta.title}</h1>
|
||||
<p className="max-w-2xl text-sm leading-relaxed text-muted-foreground">
|
||||
玩法限额、赔率、封顶三套配置各自有「草稿 → 发布」生命周期;玩家端与大厅接口只读取当前{" "}
|
||||
<span className="font-medium text-foreground">active</span> 版本。请先在本区左侧选择模块,改完后务必在对应页点击「启用为当前版本」。
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div className="space-y-10">
|
||||
{CONFIG_NAV_GROUPS.map((group) => {
|
||||
const Icon = GROUP_ICONS[group.id as keyof typeof GROUP_ICONS] ?? Layers;
|
||||
return (
|
||||
<section key={group.id} className="space-y-4">
|
||||
<div className="flex items-center gap-2 border-b border-border pb-2">
|
||||
<Icon className="size-4 text-muted-foreground" aria-hidden />
|
||||
<h2 className="text-sm font-semibold tracking-wide text-muted-foreground uppercase">
|
||||
{group.label}
|
||||
</h2>
|
||||
</div>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
{group.items.map((item) => (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
className="block rounded-xl outline-none ring-offset-background focus-visible:ring-2 focus-visible:ring-ring"
|
||||
>
|
||||
<Card className="h-full transition-colors hover:border-primary/30 hover:bg-muted/30">
|
||||
<CardHeader className="space-y-2">
|
||||
<CardTitle className="text-base">{item.title}</CardTitle>
|
||||
<CardDescription className="text-sm leading-snug">{item.description}</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ModuleScaffold>
|
||||
);
|
||||
redirect("/admin/config/plays");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user