diff --git a/src/features/authFiles/components/AuthFileCard.tsx b/src/features/authFiles/components/AuthFileCard.tsx index 75665a5..142a278 100644 --- a/src/features/authFiles/components/AuthFileCard.tsx +++ b/src/features/authFiles/components/AuthFileCard.tsx @@ -3,13 +3,7 @@ import { Button } from '@/components/ui/Button'; import { LoadingSpinner } from '@/components/ui/LoadingSpinner'; import { SelectionCheckbox } from '@/components/ui/SelectionCheckbox'; import { ToggleSwitch } from '@/components/ui/ToggleSwitch'; -import { - IconBot, - IconCode, - IconDownload, - IconInfo, - IconTrash2, -} from '@/components/ui/icons'; +import { IconBot, IconDownload, IconSettings, IconTrash2 } from '@/components/ui/icons'; import { ProviderStatusBar } from '@/components/providers/ProviderStatusBar'; import type { AuthFileItem } from '@/types'; import { resolveAuthProvider } from '@/utils/quota'; @@ -44,7 +38,6 @@ export type AuthFileCardProps = { keyStats: KeyStats; statusBarCache: Map; onShowModels: (file: AuthFileItem) => void; - onShowDetails: (file: AuthFileItem) => void; onDownload: (name: string) => void; onOpenPrefixProxyEditor: (file: AuthFileItem) => void; onDelete: (name: string) => void; @@ -71,7 +64,6 @@ export function AuthFileCard(props: AuthFileCardProps) { keyStats, statusBarCache, onShowModels, - onShowDetails, onDownload, onOpenPrefixProxyEditor, onDelete, @@ -95,13 +87,13 @@ export function AuthFileCard(props: AuthFileCardProps) { ? styles.antigravityCard : quotaType === 'claude' ? styles.claudeCard - : quotaType === 'codex' - ? styles.codexCard - : quotaType === 'gemini-cli' - ? styles.geminiCliCard - : quotaType === 'kimi' - ? styles.kimiCard - : ''; + : quotaType === 'codex' + ? styles.codexCard + : quotaType === 'gemini-cli' + ? styles.geminiCliCard + : quotaType === 'kimi' + ? styles.kimiCard + : ''; const rawAuthIndex = file['auth_index'] ?? file.authIndex; const authIndexKey = normalizeAuthIndex(rawAuthIndex); @@ -153,7 +145,8 @@ export function AuthFileCard(props: AuthFileCardProps) { {priorityValue !== undefined && ( - {t('auth_files.priority_display')}: {priorityValue} + {t('auth_files.priority_display')}:{' '} + {priorityValue} )} @@ -205,16 +198,6 @@ export function AuthFileCard(props: AuthFileCardProps) { )} {!isRuntimeOnly && ( <> - - - - } - > - {file && ( -
-
{JSON.stringify(file, null, 2)}
-
- )} - - ); -} - diff --git a/src/features/authFiles/components/AuthFilesPrefixProxyEditorModal.tsx b/src/features/authFiles/components/AuthFilesPrefixProxyEditorModal.tsx index 3e68254..4a1c8b7 100644 --- a/src/features/authFiles/components/AuthFilesPrefixProxyEditorModal.tsx +++ b/src/features/authFiles/components/AuthFilesPrefixProxyEditorModal.tsx @@ -17,13 +17,24 @@ export type AuthFilesPrefixProxyEditorModalProps = { updatedText: string; dirty: boolean; onClose: () => void; + onCopyText: (text: string) => void | Promise; onSave: () => void; onChange: (field: PrefixProxyEditorField, value: PrefixProxyEditorFieldValue) => void; }; export function AuthFilesPrefixProxyEditorModal(props: AuthFilesPrefixProxyEditorModalProps) { const { t } = useTranslation(); - const { disableControls, editor, updatedText, dirty, onClose, onSave, onChange } = props; + const { disableControls, editor, updatedText, dirty, onClose, onCopyText, onSave, onChange } = + props; + const formatJsonText = (text: string) => { + if (!text) return ''; + try { + return JSON.stringify(JSON.parse(text), null, 2); + } catch { + return text; + } + }; + const previewText = formatJsonText(updatedText); return ( +