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 */}