mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
refactor: tighten OAuth Auth Center copy, layout, and icon
- Trim Auth Center section descriptions to focus on user intent - Remove duplicate outer heading on the auth settings tab - Swap Sparkles glyph for CodexIcon on the ChatGPT card - Generalize codexOauth.authStatus to a neutral "Auth status" - Register settings.authCenter.* keys across zh/en/ja locales
This commit is contained in:
@@ -89,7 +89,7 @@ export const CodexOAuthSection: React.FC<CodexOAuthSectionProps> = ({
|
||||
<div className={`space-y-4 ${className || ""}`}>
|
||||
{/* 认证状态标题 */}
|
||||
<div className="flex items-center justify-between">
|
||||
<Label>{t("codexOauth.authStatus", "ChatGPT Plus/Pro 认证")}</Label>
|
||||
<Label>{t("codexOauth.authStatus", "认证状态")}</Label>
|
||||
<Badge
|
||||
variant={hasAnyAccount ? "default" : "secondary"}
|
||||
className={hasAnyAccount ? "bg-green-500 hover:bg-green-600" : ""}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Github, ShieldCheck, Sparkles } from "lucide-react";
|
||||
import { Github, ShieldCheck } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { CodexIcon } from "@/components/BrandIcons";
|
||||
import { CopilotAuthSection } from "@/components/providers/forms/CopilotAuthSection";
|
||||
import { CodexOAuthSection } from "@/components/providers/forms/CodexOAuthSection";
|
||||
|
||||
@@ -23,7 +24,7 @@ export function AuthCenterPanel() {
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("settings.authCenter.description", {
|
||||
defaultValue:
|
||||
"集中管理跨应用复用的 OAuth 账号。Provider 只绑定这些认证源,不再重复登录。",
|
||||
"在 Claude Code 中使用您的其他订阅,请注意合规风险。",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
@@ -42,8 +43,7 @@ export function AuthCenterPanel() {
|
||||
<h4 className="font-medium">GitHub Copilot</h4>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("settings.authCenter.copilotDescription", {
|
||||
defaultValue:
|
||||
"管理 GitHub Copilot 账号、默认账号以及供 Claude / Codex / Gemini 绑定的托管凭据。",
|
||||
defaultValue: "管理 GitHub Copilot 账号",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
@@ -55,14 +55,13 @@ export function AuthCenterPanel() {
|
||||
<section className="rounded-xl border border-border/60 bg-card/60 p-6">
|
||||
<div className="mb-4 flex items-center gap-3">
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-muted">
|
||||
<Sparkles className="h-5 w-5" />
|
||||
<CodexIcon size={20} />
|
||||
</div>
|
||||
<div>
|
||||
<h4 className="font-medium">ChatGPT (Codex OAuth)</h4>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("settings.authCenter.codexOauthDescription", {
|
||||
defaultValue:
|
||||
"管理 ChatGPT Plus/Pro 账号,用于将 Claude Code 请求反代到 Codex 后端。仅限个人开发使用。",
|
||||
defaultValue: "管理 ChatGPT 账号",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
ScrollText,
|
||||
HardDriveDownload,
|
||||
FlaskConical,
|
||||
KeyRound,
|
||||
} from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
@@ -272,23 +271,6 @@ export function SettingsPage({
|
||||
transition={{ duration: 0.3 }}
|
||||
className="space-y-6"
|
||||
>
|
||||
<div className="flex items-center gap-3 px-1">
|
||||
<KeyRound className="h-5 w-5 text-primary" />
|
||||
<div>
|
||||
<h2 className="text-base font-semibold">
|
||||
{t("settings.authCenter.heading", {
|
||||
defaultValue: "认证中心",
|
||||
})}
|
||||
</h2>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("settings.authCenter.headingDescription", {
|
||||
defaultValue:
|
||||
"统一管理可跨应用复用的 OAuth 账号和默认认证来源。",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AuthCenterPanel />
|
||||
</motion.div>
|
||||
</TabsContent>
|
||||
|
||||
@@ -225,6 +225,13 @@
|
||||
"tabGeneral": "General",
|
||||
"tabAdvanced": "Advanced",
|
||||
"tabProxy": "Proxy",
|
||||
"authCenter": {
|
||||
"title": "OAuth Authentication Center",
|
||||
"description": "Use your other subscriptions in Claude Code — please be mindful of compliance risks.",
|
||||
"beta": "Beta",
|
||||
"copilotDescription": "Manage GitHub Copilot accounts",
|
||||
"codexOauthDescription": "Manage ChatGPT accounts"
|
||||
},
|
||||
"advanced": {
|
||||
"configDir": {
|
||||
"title": "Configuration Directory",
|
||||
@@ -846,7 +853,7 @@
|
||||
"loadModelsFailed": "Failed to load Copilot models"
|
||||
},
|
||||
"codexOauth": {
|
||||
"authStatus": "ChatGPT Plus/Pro Auth",
|
||||
"authStatus": "Auth status",
|
||||
"notAuthenticated": "Not authenticated",
|
||||
"loginWithChatGPT": "Sign in with ChatGPT",
|
||||
"loginRequired": "Please sign in to ChatGPT first",
|
||||
|
||||
@@ -225,6 +225,13 @@
|
||||
"tabGeneral": "一般",
|
||||
"tabAdvanced": "詳細",
|
||||
"tabProxy": "プロキシ",
|
||||
"authCenter": {
|
||||
"title": "OAuth 認証センター",
|
||||
"description": "Claude Code で他のサブスクリプションをご利用いただけます。コンプライアンスリスクにご注意ください。",
|
||||
"beta": "Beta",
|
||||
"copilotDescription": "GitHub Copilot アカウントを管理します",
|
||||
"codexOauthDescription": "ChatGPT アカウントを管理します"
|
||||
},
|
||||
"advanced": {
|
||||
"configDir": {
|
||||
"title": "設定ディレクトリ",
|
||||
@@ -846,7 +853,7 @@
|
||||
"loadModelsFailed": "Copilot モデル一覧の読み込みに失敗しました"
|
||||
},
|
||||
"codexOauth": {
|
||||
"authStatus": "ChatGPT Plus/Pro 認証",
|
||||
"authStatus": "認証状態",
|
||||
"notAuthenticated": "未認証",
|
||||
"loginWithChatGPT": "ChatGPT でログイン",
|
||||
"loginRequired": "先に ChatGPT にログインしてください",
|
||||
|
||||
@@ -225,6 +225,13 @@
|
||||
"tabGeneral": "通用",
|
||||
"tabAdvanced": "高级",
|
||||
"tabProxy": "代理",
|
||||
"authCenter": {
|
||||
"title": "OAuth 认证中心",
|
||||
"description": "在 Claude Code 中使用您的其他订阅,请注意合规风险。",
|
||||
"beta": "Beta",
|
||||
"copilotDescription": "管理 GitHub Copilot 账号",
|
||||
"codexOauthDescription": "管理 ChatGPT 账号"
|
||||
},
|
||||
"advanced": {
|
||||
"configDir": {
|
||||
"title": "配置文件目录",
|
||||
@@ -846,7 +853,7 @@
|
||||
"loadModelsFailed": "加载 Copilot 模型列表失败"
|
||||
},
|
||||
"codexOauth": {
|
||||
"authStatus": "ChatGPT Plus/Pro 认证",
|
||||
"authStatus": "认证状态",
|
||||
"notAuthenticated": "未认证",
|
||||
"loginWithChatGPT": "使用 ChatGPT 登录",
|
||||
"loginRequired": "请先登录 ChatGPT 账号",
|
||||
|
||||
Reference in New Issue
Block a user