From 4427c17417cf1daf320a7f816abdf2e09a1a5c67 Mon Sep 17 00:00:00 2001 From: erio Date: Sat, 14 Mar 2026 01:34:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B8=A0=E9=81=93/=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86UI=E4=BC=98=E5=8C=96=20=E2=80=94=20=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=9B=BE=E6=A0=87=E3=80=81=E5=B8=83=E5=B1=80=E6=94=B9?= =?UTF-8?q?=E5=96=84=E3=80=81=E5=88=86=E7=BB=84=E4=BF=A1=E6=81=AF=E5=8D=A1?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 渠道管理:平台列用 PlatformBadge 带图标,分类下拉显示 label - 渠道管理:添加 antigravity/anthropic 平台选项 - 订阅管理:/v1/messages 调度改为"已启用/未启用"文字 - 订阅管理:编辑 modal 选择分组后展示只读分组信息卡片 - 订阅管理:有效期+单位独立一行,排序单独一行 --- src/app/admin/channels/page.tsx | 31 ++------- src/app/admin/subscriptions/page.tsx | 97 +++++++++++++++++++++------- 2 files changed, 80 insertions(+), 48 deletions(-) diff --git a/src/app/admin/channels/page.tsx b/src/app/admin/channels/page.tsx index 9b34ed8..602c9e0 100644 --- a/src/app/admin/channels/page.tsx +++ b/src/app/admin/channels/page.tsx @@ -4,6 +4,7 @@ import { useSearchParams } from 'next/navigation'; import { useState, useEffect, useCallback, Suspense } from 'react'; import PayPageLayout from '@/components/PayPageLayout'; import { resolveLocale, type Locale } from '@/lib/locale'; +import { PlatformBadge, getPlatformStyle } from '@/lib/platform-style'; // ── Types ── @@ -44,15 +45,7 @@ interface ChannelFormData { enabled: boolean; } -const PLATFORMS = ['claude', 'openai', 'gemini', 'codex', 'sora'] as const; - -const PLATFORM_COLORS: Record = { - claude: { bg: 'bg-orange-100 dark:bg-orange-900/40', text: 'text-orange-700 dark:text-orange-300' }, - openai: { bg: 'bg-green-100 dark:bg-green-900/40', text: 'text-green-700 dark:text-green-300' }, - gemini: { bg: 'bg-blue-100 dark:bg-blue-900/40', text: 'text-blue-700 dark:text-blue-300' }, - codex: { bg: 'bg-purple-100 dark:bg-purple-900/40', text: 'text-purple-700 dark:text-purple-300' }, - sora: { bg: 'bg-pink-100 dark:bg-pink-900/40', text: 'text-pink-700 dark:text-pink-300' }, -}; +const PLATFORMS = ['claude', 'anthropic', 'openai', 'gemini', 'codex', 'sora', 'antigravity'] as const; // ── i18n ── @@ -706,7 +699,6 @@ function ChannelsContent() { {channels.map((channel) => { - const pc = PLATFORM_COLORS[channel.platform] ?? PLATFORM_COLORS.claude; return ( - - {channel.platform} - + {channel.rateMultiplier}x @@ -849,7 +837,7 @@ function ChannelsContent() { > {PLATFORMS.map((p) => ( ))} @@ -1019,16 +1007,7 @@ function ChannelsContent() { #{group.id} - {(() => { - const gpc = PLATFORM_COLORS[group.platform] ?? PLATFORM_COLORS.claude; - return ( - - {group.platform} - - ); - })()} + {alreadyImported && ( {t.syncAlreadyExists} )} diff --git a/src/app/admin/subscriptions/page.tsx b/src/app/admin/subscriptions/page.tsx index dfbce1c..20da3cb 100644 --- a/src/app/admin/subscriptions/page.tsx +++ b/src/app/admin/subscriptions/page.tsx @@ -918,22 +918,15 @@ function SubscriptionsContent() { {plan.groupPlatform?.toLowerCase() === 'openai' && ( <>
- /v1/messages -
- - {plan.groupAllowMessagesDispatch ? '✓' : '✗'} - + /v1/messages 调度 +
+ {plan.groupAllowMessagesDispatch ? '已启用' : '未启用'}
{plan.groupDefaultMappedModel && (
默认模型 -
+
{plan.groupDefaultMappedModel}
@@ -1199,6 +1192,64 @@ function SubscriptionsContent() {
+ {/* Selected group info card (read-only) */} + {(() => { + const selectedGroup = groups.find((g) => String(g.id) === formGroupId); + if (!selectedGroup) return null; + return ( +
+
+ + {t.groupInfo} + + + {t.groupInfoReadonly} + +
+
+ {selectedGroup.platform && ( +
+ {t.platform} +
+
+ )} + {selectedGroup.rate_multiplier != null && ( +
+ {t.rateMultiplier} +
{selectedGroup.rate_multiplier}x
+
+ )} +
+ {t.dailyLimit} +
+ {selectedGroup.daily_limit_usd != null ? `$${selectedGroup.daily_limit_usd}` : t.unlimited} +
+
+
+ {t.weeklyLimit} +
+ {selectedGroup.weekly_limit_usd != null ? `$${selectedGroup.weekly_limit_usd}` : t.unlimited} +
+
+
+ {t.monthlyLimit} +
+ {selectedGroup.monthly_limit_usd != null ? `$${selectedGroup.monthly_limit_usd}` : t.unlimited} +
+
+ {selectedGroup.platform?.toLowerCase() === 'openai' && ( +
+ /v1/messages 调度 +
+ {selectedGroup.allow_messages_dispatch ? '已启用' : '未启用'} +
+
+ )} +
+
+ ); + })()} + {/* Name */}
@@ -1251,8 +1302,8 @@ function SubscriptionsContent() {
- {/* Valid days + Unit + Sort */} -
+ {/* Valid days + Unit */} +
{t.unitMonth}
-
- - setFormSortOrder(e.target.value)} - className={inputCls} - /> -
+
+ + {/* Sort Order */} +
+ + setFormSortOrder(e.target.value)} + className={inputCls} + />
{/* Features */}