mirror of
https://github.com/touwaeriol/sub2apipay.git
synced 2026-08-29 02:26:50 +08:00
fix: 导航统一到 layout 顶部栏,各页面移除重复导航链接
- layout.tsx 的 NAV_ITEMS 增加「支付配置」入口 - 各 admin 页面的 actions 移除重复的导航 <a> 链接,仅保留功能按钮
This commit is contained in:
@@ -57,10 +57,6 @@ function getTexts(locale: Locale) {
|
||||
invalidToken: 'Invalid admin token',
|
||||
title: 'Channel Management',
|
||||
subtitle: 'Configure and manage subscription channels',
|
||||
orders: 'Orders',
|
||||
navDashboard: 'Dashboard',
|
||||
navPaymentConfig: 'Payment Config',
|
||||
navSubscriptions: 'Subscriptions',
|
||||
refresh: 'Refresh',
|
||||
loading: 'Loading...',
|
||||
noChannels: 'No channels found',
|
||||
@@ -114,10 +110,6 @@ function getTexts(locale: Locale) {
|
||||
invalidToken: '管理员凭证无效',
|
||||
title: '渠道管理',
|
||||
subtitle: '配置和管理订阅渠道',
|
||||
orders: '订单管理',
|
||||
navDashboard: '数据概览',
|
||||
navPaymentConfig: '支付配置',
|
||||
navSubscriptions: '订阅管理',
|
||||
refresh: '刷新',
|
||||
loading: '加载中...',
|
||||
noChannels: '暂无渠道',
|
||||
@@ -469,13 +461,7 @@ function ChannelsContent() {
|
||||
}
|
||||
};
|
||||
|
||||
// ── Nav params ──
|
||||
|
||||
const navParams = new URLSearchParams();
|
||||
if (token) navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (isDark) navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
// ── Shared styles ──
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
@@ -505,22 +491,6 @@ function ChannelsContent() {
|
||||
title={t.title}
|
||||
subtitle={t.subtitle}
|
||||
locale={locale}
|
||||
actions={
|
||||
<>
|
||||
<a href={`/admin/dashboard?${navParams}`} className={btnBase}>
|
||||
{t.navDashboard}
|
||||
</a>
|
||||
<a href={`/admin/orders?${navParams}`} className={btnBase}>
|
||||
{t.orders}
|
||||
</a>
|
||||
<a href={`/admin/payment-config?${navParams}`} className={btnBase}>
|
||||
{t.navPaymentConfig}
|
||||
</a>
|
||||
<a href={`/admin/subscriptions?${navParams}`} className={btnBase}>
|
||||
{t.navSubscriptions}
|
||||
</a>
|
||||
</>
|
||||
}
|
||||
>
|
||||
{/* Error banner */}
|
||||
{error && (
|
||||
|
||||
@@ -52,10 +52,6 @@ function DashboardContent() {
|
||||
title: 'Dashboard',
|
||||
subtitle: 'Recharge order analytics and insights',
|
||||
daySuffix: 'd',
|
||||
navOrders: 'Orders',
|
||||
navPaymentConfig: 'Payment Config',
|
||||
navChannels: 'Channels',
|
||||
navSubscriptions: 'Subscriptions',
|
||||
refresh: 'Refresh',
|
||||
loading: 'Loading...',
|
||||
}
|
||||
@@ -68,10 +64,6 @@ function DashboardContent() {
|
||||
title: '数据概览',
|
||||
subtitle: '充值订单统计与分析',
|
||||
daySuffix: '天',
|
||||
navOrders: '订单管理',
|
||||
navPaymentConfig: '支付配置',
|
||||
navChannels: '渠道管理',
|
||||
navSubscriptions: '订阅管理',
|
||||
refresh: '刷新',
|
||||
loading: '加载中...',
|
||||
};
|
||||
@@ -117,12 +109,6 @@ function DashboardContent() {
|
||||
);
|
||||
}
|
||||
|
||||
const navParams = new URLSearchParams();
|
||||
navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (theme === 'dark') navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
isDark
|
||||
@@ -151,18 +137,6 @@ function DashboardContent() {
|
||||
{text.daySuffix}
|
||||
</button>
|
||||
))}
|
||||
<a href={`/admin/orders?${navParams}`} className={btnBase}>
|
||||
{text.navOrders}
|
||||
</a>
|
||||
<a href={`/admin/payment-config?${navParams}`} className={btnBase}>
|
||||
{text.navPaymentConfig}
|
||||
</a>
|
||||
<a href={`/admin/channels?${navParams}`} className={btnBase}>
|
||||
{text.navChannels}
|
||||
</a>
|
||||
<a href={`/admin/subscriptions?${navParams}`} className={btnBase}>
|
||||
{text.navSubscriptions}
|
||||
</a>
|
||||
<button type="button" onClick={fetchData} className={btnBase}>
|
||||
{text.refresh}
|
||||
</button>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { resolveLocale } from '@/lib/locale';
|
||||
const NAV_ITEMS = [
|
||||
{ path: '/admin', label: { zh: '数据概览', en: 'Dashboard' } },
|
||||
{ path: '/admin/orders', label: { zh: '订单管理', en: 'Orders' } },
|
||||
{ path: '/admin/payment-config', label: { zh: '支付配置', en: 'Payment Config' } },
|
||||
{ path: '/admin/channels', label: { zh: '渠道管理', en: 'Channels' } },
|
||||
{ path: '/admin/subscriptions', label: { zh: '订阅管理', en: 'Subscriptions' } },
|
||||
];
|
||||
|
||||
@@ -74,10 +74,6 @@ function AdminContent() {
|
||||
loadDetailFailed: 'Failed to load order details',
|
||||
title: 'Order Management',
|
||||
subtitle: 'View and manage all recharge orders',
|
||||
dashboard: 'Dashboard',
|
||||
navPaymentConfig: 'Payment Config',
|
||||
navChannels: 'Channels',
|
||||
navSubscriptions: 'Subscriptions',
|
||||
refresh: 'Refresh',
|
||||
loading: 'Loading...',
|
||||
orderTypes: {
|
||||
@@ -112,10 +108,6 @@ function AdminContent() {
|
||||
loadDetailFailed: '加载订单详情失败',
|
||||
title: '订单管理',
|
||||
subtitle: '查看和管理所有充值订单',
|
||||
dashboard: '数据概览',
|
||||
navPaymentConfig: '支付配置',
|
||||
navChannels: '渠道管理',
|
||||
navSubscriptions: '订阅管理',
|
||||
refresh: '刷新',
|
||||
loading: '加载中...',
|
||||
orderTypes: {
|
||||
@@ -242,12 +234,6 @@ function AdminContent() {
|
||||
const orderTypes = ['', 'balance', 'subscription'];
|
||||
const orderTypeLabels: Record<string, string> = text.orderTypes;
|
||||
|
||||
const navParams = new URLSearchParams();
|
||||
if (token) navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (isDark) navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
isDark
|
||||
@@ -265,18 +251,6 @@ function AdminContent() {
|
||||
locale={locale}
|
||||
actions={
|
||||
<>
|
||||
<a href={`/admin/dashboard?${navParams}`} className={btnBase}>
|
||||
{text.dashboard}
|
||||
</a>
|
||||
<a href={`/admin/payment-config?${navParams}`} className={btnBase}>
|
||||
{text.navPaymentConfig}
|
||||
</a>
|
||||
<a href={`/admin/channels?${navParams}`} className={btnBase}>
|
||||
{text.navChannels}
|
||||
</a>
|
||||
<a href={`/admin/subscriptions?${navParams}`} className={btnBase}>
|
||||
{text.navSubscriptions}
|
||||
</a>
|
||||
<button type="button" onClick={fetchOrders} className={btnBase}>
|
||||
{text.refresh}
|
||||
</button>
|
||||
|
||||
@@ -52,10 +52,6 @@ function DashboardContent() {
|
||||
title: 'Dashboard',
|
||||
subtitle: 'Recharge order analytics and insights',
|
||||
daySuffix: 'd',
|
||||
navOrders: 'Orders',
|
||||
navPaymentConfig: 'Payment Config',
|
||||
navChannels: 'Channels',
|
||||
navSubscriptions: 'Subscriptions',
|
||||
refresh: 'Refresh',
|
||||
loading: 'Loading...',
|
||||
}
|
||||
@@ -68,10 +64,6 @@ function DashboardContent() {
|
||||
title: '数据概览',
|
||||
subtitle: '充值订单统计与分析',
|
||||
daySuffix: '天',
|
||||
navOrders: '订单管理',
|
||||
navPaymentConfig: '支付配置',
|
||||
navChannels: '渠道管理',
|
||||
navSubscriptions: '订阅管理',
|
||||
refresh: '刷新',
|
||||
loading: '加载中...',
|
||||
};
|
||||
@@ -117,12 +109,6 @@ function DashboardContent() {
|
||||
);
|
||||
}
|
||||
|
||||
const navParams = new URLSearchParams();
|
||||
navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (theme === 'dark') navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
isDark
|
||||
@@ -151,18 +137,6 @@ function DashboardContent() {
|
||||
{text.daySuffix}
|
||||
</button>
|
||||
))}
|
||||
<a href={`/admin/orders?${navParams}`} className={btnBase}>
|
||||
{text.navOrders}
|
||||
</a>
|
||||
<a href={`/admin/payment-config?${navParams}`} className={btnBase}>
|
||||
{text.navPaymentConfig}
|
||||
</a>
|
||||
<a href={`/admin/channels?${navParams}`} className={btnBase}>
|
||||
{text.navChannels}
|
||||
</a>
|
||||
<a href={`/admin/subscriptions?${navParams}`} className={btnBase}>
|
||||
{text.navSubscriptions}
|
||||
</a>
|
||||
<button type="button" onClick={fetchData} className={btnBase}>
|
||||
{text.refresh}
|
||||
</button>
|
||||
|
||||
@@ -15,10 +15,6 @@ function getTexts(locale: Locale) {
|
||||
invalidToken: 'Invalid admin token',
|
||||
title: 'Payment Config',
|
||||
subtitle: 'Configure recharge and payment settings',
|
||||
dashboard: 'Dashboard',
|
||||
orders: 'Orders',
|
||||
channels: 'Channels',
|
||||
subscriptions: 'Subscriptions',
|
||||
productNamePrefix: 'Product Name Prefix',
|
||||
productNameSuffix: 'Product Name Suffix',
|
||||
preview: 'Preview',
|
||||
@@ -47,10 +43,6 @@ function getTexts(locale: Locale) {
|
||||
invalidToken: '管理员凭证无效',
|
||||
title: '支付配置',
|
||||
subtitle: '充值与支付相关配置',
|
||||
dashboard: '数据概览',
|
||||
orders: '订单管理',
|
||||
channels: '渠道管理',
|
||||
subscriptions: '订阅管理',
|
||||
productNamePrefix: '商品名前缀',
|
||||
productNameSuffix: '商品名后缀',
|
||||
preview: '预览',
|
||||
@@ -212,21 +204,6 @@ function PaymentConfigContent() {
|
||||
);
|
||||
}
|
||||
|
||||
// ── Nav params ──
|
||||
|
||||
const navParams = new URLSearchParams();
|
||||
if (token) navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (isDark) navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
isDark
|
||||
? 'border-slate-600 text-slate-200 hover:bg-slate-800'
|
||||
: 'border-slate-300 text-slate-700 hover:bg-slate-100',
|
||||
].join(' ');
|
||||
|
||||
// ── Shared input classes ──
|
||||
|
||||
const inputCls = [
|
||||
@@ -248,22 +225,6 @@ function PaymentConfigContent() {
|
||||
title={t.title}
|
||||
subtitle={t.subtitle}
|
||||
locale={locale}
|
||||
actions={
|
||||
<>
|
||||
<a href={`/admin/dashboard?${navParams}`} className={btnBase}>
|
||||
{t.dashboard}
|
||||
</a>
|
||||
<a href={`/admin/orders?${navParams}`} className={btnBase}>
|
||||
{t.orders}
|
||||
</a>
|
||||
<a href={`/admin/channels?${navParams}`} className={btnBase}>
|
||||
{t.channels}
|
||||
</a>
|
||||
<a href={`/admin/subscriptions?${navParams}`} className={btnBase}>
|
||||
{t.subscriptions}
|
||||
</a>
|
||||
</>
|
||||
}
|
||||
>
|
||||
{/* Error banner */}
|
||||
{error && (
|
||||
|
||||
@@ -79,10 +79,6 @@ function buildText(locale: Locale) {
|
||||
requestFailed: 'Request failed',
|
||||
title: 'Subscription Management',
|
||||
subtitle: 'Manage subscription plans and user subscriptions',
|
||||
orders: 'Order Management',
|
||||
dashboard: 'Dashboard',
|
||||
navPaymentConfig: 'Payment Config',
|
||||
navChannels: 'Channels',
|
||||
refresh: 'Refresh',
|
||||
loading: 'Loading...',
|
||||
tabPlans: 'Plan Configuration',
|
||||
@@ -163,10 +159,6 @@ function buildText(locale: Locale) {
|
||||
requestFailed: '请求失败',
|
||||
title: '订阅管理',
|
||||
subtitle: '管理订阅套餐与用户订阅',
|
||||
orders: '订单管理',
|
||||
dashboard: '数据概览',
|
||||
navPaymentConfig: '支付配置',
|
||||
navChannels: '渠道管理',
|
||||
refresh: '刷新',
|
||||
loading: '加载中...',
|
||||
tabPlans: '套餐配置',
|
||||
@@ -608,12 +600,6 @@ function SubscriptionsContent() {
|
||||
}
|
||||
|
||||
/* --- nav params --- */
|
||||
const navParams = new URLSearchParams();
|
||||
navParams.set('token', token);
|
||||
if (locale === 'en') navParams.set('lang', 'en');
|
||||
if (isDark) navParams.set('theme', 'dark');
|
||||
if (isEmbedded) navParams.set('ui_mode', 'embedded');
|
||||
|
||||
const btnBase = [
|
||||
'inline-flex items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
isDark
|
||||
@@ -700,18 +686,6 @@ function SubscriptionsContent() {
|
||||
locale={locale}
|
||||
actions={
|
||||
<>
|
||||
<a href={`/admin/dashboard?${navParams}`} className={btnBase}>
|
||||
{t.dashboard}
|
||||
</a>
|
||||
<a href={`/admin/orders?${navParams}`} className={btnBase}>
|
||||
{t.orders}
|
||||
</a>
|
||||
<a href={`/admin/payment-config?${navParams}`} className={btnBase}>
|
||||
{t.navPaymentConfig}
|
||||
</a>
|
||||
<a href={`/admin/channels?${navParams}`} className={btnBase}>
|
||||
{t.navChannels}
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user