diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 621be37..6ff7a27 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -778,7 +778,7 @@ "gemini_cli_oauth_hint": "Login to Google Gemini CLI service through OAuth flow, automatically obtain and save authentication files.", "gemini_cli_project_id_label": "Google Cloud Project ID (Optional):", "gemini_cli_project_id_placeholder": "Leave blank to auto-select first available project", - "gemini_cli_project_id_hint": "Optional. If not provided, the system will automatically select the first available project from your account.", + "gemini_cli_project_id_hint": "Optional. If not provided, the system will automatically select the first available project from your account. Enter ALL to fetch all projects.", "gemini_cli_project_id_required": "Please enter a Google Cloud project ID.", "gemini_cli_oauth_url_label": "Authorization URL:", "gemini_cli_open_link": "Open Link", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index b20eba6..83b04cc 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -781,7 +781,7 @@ "gemini_cli_oauth_hint": "Выполните вход в сервис Google Gemini CLI через OAuth и автоматически получите/сохраните файлы авторизации.", "gemini_cli_project_id_label": "Google Cloud Project ID (необязательно):", "gemini_cli_project_id_placeholder": "Оставьте пустым, чтобы выбрать первый доступный проект автоматически", - "gemini_cli_project_id_hint": "Необязательно. Если не указано, система автоматически выберет первый доступный проект вашей учётной записи.", + "gemini_cli_project_id_hint": "Необязательно. Если не указано, система автоматически выберет первый доступный проект вашей учётной записи. Введите ALL, чтобы получить все проекты.", "gemini_cli_project_id_required": "Укажите идентификатор проекта Google Cloud.", "gemini_cli_oauth_url_label": "URL авторизации:", "gemini_cli_open_link": "Открыть ссылку", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 7c8b692..0638682 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -778,7 +778,7 @@ "gemini_cli_oauth_hint": "通过 OAuth 流程登录 Google Gemini CLI 服务,自动获取并保存认证文件。", "gemini_cli_project_id_label": "Google Cloud 项目 ID (可选):", "gemini_cli_project_id_placeholder": "留空将自动选择第一个可用项目", - "gemini_cli_project_id_hint": "可选填写项目 ID。如不填写,系统将自动选择您账号下的第一个可用项目。", + "gemini_cli_project_id_hint": "可选填写项目 ID。如不填写,系统将自动选择您账号下的第一个可用项目。输入 ALL 可获取全部项目。", "gemini_cli_project_id_required": "请填写 Google Cloud 项目 ID。", "gemini_cli_oauth_url_label": "授权链接:", "gemini_cli_open_link": "打开链接", diff --git a/src/pages/OAuthPage.module.scss b/src/pages/OAuthPage.module.scss index 081c2f5..ec29eea 100644 --- a/src/pages/OAuthPage.module.scss +++ b/src/pages/OAuthPage.module.scss @@ -150,6 +150,13 @@ margin-bottom: 0; gap: $spacing-sm; } + + :global(.input:disabled) { + background-color: var(--bg-tertiary); + border-color: var(--border-color); + color: var(--text-tertiary); + cursor: not-allowed; + } } .formItem { diff --git a/src/pages/OAuthPage.tsx b/src/pages/OAuthPage.tsx index 8cb3e34..250ffed 100644 --- a/src/pages/OAuthPage.tsx +++ b/src/pages/OAuthPage.tsx @@ -153,8 +153,14 @@ export function OAuthPage() { }; const startAuth = async (provider: OAuthProvider) => { - const projectId = provider === 'gemini-cli' ? (states[provider]?.projectId || '').trim() : undefined; - // 项目 ID 现在是可选的,如果不输入将自动选择第一个可用项目 + const geminiState = provider === 'gemini-cli' ? states[provider] : undefined; + const rawProjectId = provider === 'gemini-cli' ? (geminiState?.projectId || '').trim() : ''; + const projectId = rawProjectId + ? rawProjectId.toUpperCase() === 'ALL' + ? 'ALL' + : rawProjectId + : undefined; + // 项目 ID 可选:留空自动选择第一个可用项目;输入 ALL 获取全部项目 if (provider === 'gemini-cli') { updateProviderState(provider, { projectIdError: undefined }); } @@ -367,6 +373,7 @@ export function OAuthPage() { hint={t('auth_login.gemini_cli_project_id_hint')} value={state.projectId || ''} error={state.projectIdError} + disabled={Boolean(state.polling)} onChange={(e) => updateProviderState(provider.id, { projectId: e.target.value,