feat: add Ampcode (Amp CLI Integration) support with configuration UI and i18n

- Add ampcodeApi service for upstream URL, API key, and model mappings management
  - Implement Ampcode configuration modal in AiProvidersPage
  - Add complete i18n translations for Ampcode features (en and zh-CN)
  - Enhance UsagePage with mobile-responsive chart improvements and legend display
  - Optimize chart rendering for smaller screens
  - Improve page layout styles (SystemPage, AiProvidersPage alignment)
This commit is contained in:
Supra4E8C
2025-12-14 00:31:05 +08:00
parent c4034c6467
commit e0584af365
14 changed files with 744 additions and 40 deletions

View File

@@ -37,6 +37,7 @@ const SECTION_KEYS: RawConfigSection[] = [
'logging-to-file',
'ws-auth',
'api-keys',
'ampcode',
'gemini-api-key',
'codex-api-key',
'claude-api-key',
@@ -65,6 +66,8 @@ const extractSectionValue = (config: Config | null, section?: RawConfigSection)
return config.wsAuth;
case 'api-keys':
return config.apiKeys;
case 'ampcode':
return config.ampcode;
case 'gemini-api-key':
return config.geminiApiKeys;
case 'codex-api-key':
@@ -166,6 +169,9 @@ export const useConfigStore = create<ConfigState>((set, get) => ({
case 'api-keys':
nextConfig.apiKeys = value;
break;
case 'ampcode':
nextConfig.ampcode = value;
break;
case 'gemini-api-key':
nextConfig.geminiApiKeys = value;
break;