mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
merge: gemini-cli ALL mode and OAuth input polish
refactor(gemini-cli): simplify project id input flow and support ALL mode
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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": "Открыть ссылку",
|
||||
|
||||
@@ -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": "打开链接",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user