diff --git a/src/components/RelayStationManager.tsx b/src/components/RelayStationManager.tsx index 04f0fbb..4eeb7fc 100644 --- a/src/components/RelayStationManager.tsx +++ b/src/components/RelayStationManager.tsx @@ -54,7 +54,7 @@ const RelayStationManager: React.FC = ({ onBack }) => const [currentConfig, setCurrentConfig] = useState>({}); const [loadingConfig, setLoadingConfig] = useState(false); const [toast, setToast] = useState<{ message: string; type: "success" | "error" } | null>(null); - + // PackyCode 额度相关状态 const [quotaData, setQuotaData] = useState>({}); const [loadingQuota, setLoadingQuota] = useState>({}); @@ -399,7 +399,7 @@ const RelayStationManager: React.FC = ({ onBack }) =>
-
{ const daily_spent = Number(quotaData[station.id].daily_spent_usd || 0); @@ -438,7 +438,7 @@ const RelayStationManager: React.FC = ({ onBack }) =>
-
{ const monthly_spent = Number(quotaData[station.id].monthly_spent_usd || 0); @@ -499,6 +499,7 @@ const RelayStationManager: React.FC = ({ onBack }) => setShowEditDialog(true); }} > + 测试
- +

- {packycodeService === 'taxi' + {packycodeService === 'taxi' ? `${t('relayStation.fixedUrl')}: https://share-api.packycode.com` : t('relayStation.busServiceNote') } @@ -830,9 +831,9 @@ const CreateStationDialog: React.FC<{ const best = await api.autoSelectBestNode(); setPackycodeNode(best.url); setFormData(prev => ({ ...prev, api_url: best.url })); - setFormToast({ - message: `已选择最快节点: ${best.name} (延迟: ${best.response_time}ms)`, - type: "success" + setFormToast({ + message: `已选择最快节点: ${best.name} (延迟: ${best.response_time}ms)`, + type: "success" }); } catch (error) { setFormToast({ message: "节点测速失败", type: "error" }); @@ -842,7 +843,7 @@ const CreateStationDialog: React.FC<{ 自动选择 - +

{t('relayStation.selectedNode') + ': ' + packycodeNode}

@@ -967,8 +968,8 @@ const CreateStationDialog: React.FC<{ - - + - +

{t('relayStation.selectedNode') + ': ' + packycodeNode}

@@ -1364,8 +1365,8 @@ const EditStationDialog: React.FC<{ - + + + {themes.map((themeOption) => { + const ThemeIcon = themeOption.icon; + return ( + handleThemeChange(themeOption.key)} + className="flex items-center justify-between cursor-pointer" + > +
+ +
+ {themeOption.name} + {themeOption.description} +
+
+ {theme === themeOption.key && ( + + )} +
+ ); + })} +
+ + ); +}; \ No newline at end of file diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index 1229850..cd6bed4 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -4,6 +4,7 @@ import { Circle, FileText, Settings, ExternalLink, BarChart3, Network, Info, Bot import { Button } from "@/components/ui/button"; import { Popover } from "@/components/ui/popover"; import { LanguageSwitcher } from "@/components/LanguageSwitcher"; +import { ThemeSwitcher } from "@/components/ThemeSwitcher"; import { useTranslation } from "@/hooks/useTranslation"; import { api, type ClaudeVersionStatus } from "@/lib/api"; import { cn } from "@/lib/utils"; @@ -240,6 +241,9 @@ export const Topbar: React.FC = ({ {/* Language Switcher */} + {/* Theme Switcher */} + +