nomadro/app/admin/page.tsx
eric 56b29205e7 Integrate four verticals into nomadro portal with shared packages and API gateway.
Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 20:16:44 -05:00

111 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
import Link from "next/link";
import { resolvePayProvider } from "@nomadro/pay";
import { resolvePocketBaseConfig } from "@nomadro/pb";
import styles from "./admin.module.css";
const MODULES = [
{
id: "nav",
emoji: "🧭",
name: "出海导航",
href: "/nav",
admin: null as string | null,
note: "静态导航 · 无独立 admin",
},
{
id: "book",
emoji: "📖",
name: "数字游民小册",
href: "/book",
admin: "/book/admin",
note: "ebook admin · Creem / NOWPayments",
},
{
id: "community",
emoji: "🌏",
name: "旅居社群",
href: "/community",
admin: "/community",
note: "社群运营入口 · FastAPI /api/v1",
},
{
id: "vip",
emoji: "👑",
name: "私域会员",
href: "/vip",
admin: "/vip",
note: "异度星球 · payjsapi · zpay/xpay",
},
] as const;
export default function AdminPage() {
const pay = resolvePayProvider({ region: "auto", isChinaUser: true });
const pb = resolvePocketBaseConfig();
return (
<main className={styles.shell}>
<header className={styles.hero}>
<p className={styles.eyebrow}>Nomadro · Control</p>
<h1 className={styles.title}>管理后台面板</h1>
<p className={styles.sub}>
模块化入口:各垂直自带能力,本页只做编排与跳转,不堆业务逻辑。
</p>
</header>
<section className={styles.grid} aria-label="业务模块">
{MODULES.map((m) => (
<article key={m.id} className={styles.card}>
<div className={styles.cardTop}>
<span className={styles.emoji} aria-hidden>
{m.emoji}
</span>
<h2 className={styles.cardTitle}>{m.name}</h2>
</div>
<p className={styles.cardNote}>{m.note}</p>
<div className={styles.actions}>
<Link href={m.href} className={styles.btn}>
打开产品
</Link>
{m.admin ? (
<Link href={m.admin} className={`${styles.btn} ${styles.ghost}`}>
运营入口
</Link>
) : (
<span className={`${styles.btn} ${styles.ghost} ${styles.disabled}`}>
暂无 admin
</span>
)}
</div>
</article>
))}
</section>
<section className={styles.meta} aria-label="共享基础设施">
<h2 className={styles.metaTitle}>共享层 @nomadro/*</h2>
<ul className={styles.metaList}>
<li>
<strong>支付路由</strong>:当前 CN 默认 →{" "}
<code className={styles.code}>
{pay.provider}/{pay.env}/{pay.channel}
</code>
</li>
<li>
<strong>PocketBase</strong>:public{" "}
<code className={styles.code}>{pb.publicUrl}</code>
</li>
<li>
<strong>SDK</strong>:<code className={styles.code}>@nomadro/sdk</code>{" "}
供小程序 / 外部项目调用
</li>
<li>
<strong>支付后端</strong>:
<code className={styles.code}>apps/payjsapi</code>(FastAPI :8007)
</li>
</ul>
</section>
</main>
);
}