feat(frontend): optimize gemini setup ui and usage visualization

- refactor: clarify gemini auth types (Built-in vs Custom)
- feat: add setup guide with checklist and official links
- feat: display simulated daily quota progress bar
- style: apply brand-aligned colors (Blue/Gray) to gemini sections
This commit is contained in:
IanShaw027
2026-01-01 04:22:50 +08:00
parent 06d483fa8d
commit 83688c9281
7 changed files with 604 additions and 50 deletions

View File

@@ -1082,10 +1082,10 @@ export default {
stateWarningTitle: 'Note',
stateWarningDesc: 'Recommended: paste the full callback URL (includes code & state).',
oauthTypeLabel: 'OAuth Type',
needsProjectId: 'For GCP Developers',
needsProjectIdDesc: 'Requires GCP project',
noProjectIdNeeded: 'For Regular Users',
noProjectIdNeededDesc: 'Requires admin-configured OAuth client',
needsProjectId: 'Built-in OAuth (Code Assist)',
needsProjectIdDesc: 'Requires GCP project and Project ID',
noProjectIdNeeded: 'Custom OAuth (AI Studio)',
noProjectIdNeededDesc: 'Requires admin-configured OAuth client',
aiStudioNotConfiguredShort: 'Not configured',
aiStudioNotConfiguredTip:
'AI Studio OAuth is not configured: set GEMINI_OAUTH_CLIENT_ID / GEMINI_OAUTH_CLIENT_SECRET and add Redirect URI: http://localhost:1455/auth/callback (Consent screen scopes must include https://www.googleapis.com/auth/generative-language.retriever)',
@@ -1120,7 +1120,95 @@ export default {
modelPassthroughDesc:
'All model requests are forwarded directly to the Gemini API without model restrictions or mappings.',
baseUrlHint: 'Leave default for official Gemini API',
apiKeyHint: 'Your Gemini API Key (starts with AIza)'
apiKeyHint: 'Your Gemini API Key (starts with AIza)',
accountType: {
oauthTitle: 'OAuth (Gemini)',
oauthDesc: 'Authorize with your Google account and choose an OAuth type.',
apiKeyTitle: 'API Key (AI Studio)',
apiKeyDesc: 'Fastest setup. Use an AIza API key.',
apiKeyNote:
'Best for light testing. Free tier has strict rate limits and data may be used for training.',
apiKeyLink: 'Get API Key',
quotaLink: 'Quota guide'
},
oauthType: {
builtInTitle: 'Built-in OAuth (Gemini CLI / Code Assist)',
builtInDesc: 'Uses Google built-in client ID. No admin configuration required.',
builtInRequirement: 'Requires a GCP project and Project ID.',
gcpProjectLink: 'Create project',
customTitle: 'Custom OAuth (AI Studio OAuth)',
customDesc: 'Uses admin-configured OAuth client for org management.',
customRequirement: 'Admin must configure Client ID and add you as a test user.',
badges: {
recommended: 'Recommended',
highConcurrency: 'High concurrency',
noAdmin: 'No admin setup',
orgManaged: 'Org managed',
adminRequired: 'Admin required'
}
},
setupGuide: {
title: 'Gemini Setup Checklist',
checklistTitle: 'Checklist',
checklistItems: {
usIp: 'Use a US IP and ensure your account country is set to US.',
age: 'Account must be 18+.'
},
activationTitle: 'One-click Activation',
activationItems: {
geminiWeb: 'Activate Gemini Web to avoid User not initialized.',
gcpProject: 'Activate a GCP project and get the Project ID for Code Assist.'
},
links: {
countryCheck: 'Check country association',
geminiWebActivation: 'Activate Gemini Web',
gcpProject: 'Open GCP Console'
}
},
quotaPolicy: {
title: 'Gemini Quota & Limit Policy (Reference)',
note: 'Note: Gemini does not provide an official quota inquiry API. The "Daily Quota" shown here is an estimate simulated by the system based on account tiers for scheduling reference only. Please refer to official Google errors for actual limits.',
columns: {
channel: 'Auth Channel',
account: 'Account Status',
limits: 'Limit Policy',
docs: 'Official Docs'
},
docs: {
codeAssist: 'Code Assist Quotas',
aiStudio: 'AI Studio Pricing',
vertex: 'Vertex AI Quotas'
},
simulatedNote: 'Simulated quota, for reference only',
rows: {
cli: {
channel: 'Gemini CLI (Official Google Login / Code Assist)',
free: 'Free Google Account',
premium: 'Google One AI Premium',
limitsFree: 'RPD ~1000; RPM ~60 (soft)',
limitsPremium: 'RPD ~1500+; RPM ~60+ (priority queue)'
},
gcloud: {
channel: 'GCP Code Assist (gcloud auth)',
account: 'No Code Assist subscription',
limits: 'RPD ~1000; RPM ~60 (preview)'
},
aiStudio: {
channel: 'AI Studio API Key / OAuth',
free: 'No billing (free tier)',
paid: 'Billing enabled (pay-as-you-go)',
limitsFree: 'RPD 50; RPM 2 (Pro) / 15 (Flash)',
limitsPaid: 'RPD unlimited; RPM 1000+ (per model quota)'
},
customOAuth: {
channel: 'Custom OAuth Client (GCP)',
free: 'Project not billed',
paid: 'Project billed',
limitsFree: 'RPD 50; RPM 2 (project quota)',
limitsPaid: 'RPD unlimited; RPM 1000+ (project quota)'
}
}
}
},
// Re-Auth Modal
reAuthorizeAccount: 'Re-Authorize Account',
@@ -1186,6 +1274,9 @@ export default {
},
usageWindow: {
statsTitle: '5-Hour Window Usage Statistics',
statsTitleDaily: 'Daily Usage Statistics',
geminiProDaily: 'RPD Pro',
geminiFlashDaily: 'RPD Flash',
gemini3Pro: 'G3P',
gemini3Flash: 'G3F',
gemini3Image: 'G3I',