feat(auth): enhance AuthDialog with error handling and update API key link

This commit is contained in:
mingholy.lmh 2026-02-11 16:48:54 +08:00
parent a8a05188cb
commit 54d9073cc0
9 changed files with 47 additions and 5 deletions

View file

@ -11,12 +11,16 @@ import { TextInput } from './shared/TextInput.js';
import { Colors } from '../colors.js';
import { useKeypress } from '../hooks/useKeypress.js';
import { t } from '../../i18n/index.js';
import Link from 'ink-link';
interface ApiKeyInputProps {
onSubmit: (apiKey: string) => void;
onCancel: () => void;
}
const CODING_PLAN_API_KEY_URL =
'https://bailian.console.aliyun.com/?tab=model#/efm/coding_plan';
export function ApiKeyInput({
onSubmit,
onCancel,
@ -51,6 +55,16 @@ export function ApiKeyInput({
<Text color={Colors.AccentRed}>{error}</Text>
</Box>
)}
<Box marginTop={1}>
<Text>{t('You can get your exclusive Coding Plan API-KEY here:')}</Text>
</Box>
<Box marginTop={0}>
<Link url={CODING_PLAN_API_KEY_URL} fallback={false}>
<Text color={Colors.AccentGreen} underline>
{CODING_PLAN_API_KEY_URL}
</Text>
</Link>
</Box>
<Box marginTop={1}>
<Text color={Colors.Gray}>
{t('(Press Enter to submit, Escape to cancel)')}