Commit Graph
881 Commits
Author SHA1 Message Date
LTbinglingfeng bbd69ffa81 refactor(auth-files): reuse shared provider type label in OAuth edit pages
Both edit pages re-implemented getTypeLabel locally although the authFiles constants module already exports it (with provider-key normalization on top).
2026-06-13 02:27:43 +08:00
LTbinglingfeng ac9cc45736 refactor(config): table-drive scalar dirty-field tracking
getNextDirtyFields already had an updateScalarDirty list for twenty fields but spelled out twenty-seven more as identical hasOwnProperty/=== blocks. Fold them into the list; payload-rule and nested streaming comparisons keep their custom equality checks.
2026-06-13 02:26:56 +08:00
LTbinglingfeng c79f58a4ac perf(dashboard): derive stats from the cached config
The dashboard fired eight requests on every visit although seven of them (management keys, per-provider key lists, ampcode) are already present on the normalized config it subscribes to. Keep only the auth-files fetch and read everything else from the store; fetchConfig() is deduped and TTL-cached.
2026-06-13 02:25:39 +08:00
LTbinglingfeng a4fcd76998 refactor(hooks): extract shared api-key resolution for model fetching
DashboardPage and SystemPage carried byte-identical copies of normalizeApiKeyList plus a per-connection cache for resolving the key used by /models probes. Move the logic into useApiKeysForModels and reuse it from both pages.
2026-06-13 02:21:46 +08:00
LTbinglingfeng 297e29bcf3 refactor(providers): drop redundant cache invalidation in workbench
useConfigStore.updateConfigValue already invalidates the section cache internally; the 16 clearCache calls issued right after it were no-ops.
2026-06-13 02:17:45 +08:00
LTbinglingfeng 5e7225da21 refactor(providers): expose model names and priority on the resource view model
The workbench page reached back into resource.raw with brand-specific parsing to derive model names and priority, bypassing the adapter layer. Normalize both in the adapters and consume the typed fields.
2026-06-13 02:15:43 +08:00
LTbinglingfeng f62b09a57b refactor(providers): share the brand logo map
ProviderCategoryList and ProviderResourcePanel each kept an identical brand-to-logo table; move it to a single module.
2026-06-13 02:14:00 +08:00
LTbinglingfeng d268be1400 refactor(providers): unify upstream base-url normalization
normalizeOpenAIBaseUrl, normalizeClaudeBaseUrl and normalizeGeminiBaseUrl were identical except for the empty-input fallback; collapse them into one helper with a fallback parameter.
2026-06-13 02:12:17 +08:00
LTbinglingfeng cd44dca9c0 refactor(utils): share isRecord and getErrorMessage helpers
isRecord was declared locally in 15 modules (with two divergent shapes) and getErrorMessage in 7. Move a single canonical pair into utils/helpers and import it everywhere. The shared isRecord excludes arrays; the call sites that previously allowed them only read named properties, so behavior is unchanged.
2026-06-13 02:11:21 +08:00
LTbinglingfeng 93f3b6b7ab perf(auth-files): sort locally without refetching the file list
Sorting is computed in a useMemo over already-loaded files; changing the sort mode does not need a network round-trip. Also drop a duplicated property read in the priority comparator.
2026-06-13 02:06:14 +08:00
LTbinglingfeng 521350505d refactor(login): drop ineffective guard around auto-login loading reset
The finally block read autoLoginSuccess from the mount-time closure, so the condition was always true and the guard never did anything. The splash stays visible through the autoLoginSuccess flag.
2026-06-13 02:05:21 +08:00
LTbinglingfeng 07cdc5a8c4 refactor(storage): remove unused helpers and legacy aliases
clear()/hasItem() and the secureStorage/encryptData/decryptData/isEncrypted aliases had no callers. migratePlaintextKeys now reuses isObfuscated instead of duplicating the prefix literal.
2026-06-13 02:04:45 +08:00
LTbinglingfeng 403c51c31b refactor(layout): drop transition rules for removed provider sub-routes
/ai-providers/* now redirects to the single workbench page, so the per-brand route ordering and the in-section slide variant can never apply. Generic prefix matching already covers the redirect flash.
2026-06-13 02:03:44 +08:00
LTbinglingfeng 9d908fcafd refactor(providers): remove dead issue and path scaffolding
snapshot.issues was always empty and group.issue always null, so the issue badges and warning panels could never render. group.path / PROVIDER_PATHS were written but never read. Strip the fields, their render branches and the orphan styles.
2026-06-13 02:02:43 +08:00
LTbinglingfeng 0b56b998a7 refactor(providers): remove unused index-based PATCH endpoints
updateGeminiKey, updateCodexConfig, updateClaudeConfig, updateVertexConfig and updateOpenAIProvider had no callers; the workbench saves whole lists via PUT and only updateOpenAIProviderDisabled is used for toggling.
2026-06-13 01:57:12 +08:00
LTbinglingfeng 242159b571 perf(quota): drop discarded config.yaml prefetch
The quota page fetched /config.yaml on mount and on every header refresh but ignored the response; quota sections never consume it. Remove the fetch to save a request per visit.
2026-06-13 01:56:07 +08:00
LTbinglingfeng 9fae287148 feat: add Plugin Store page for browsing and managing plugins
- Implemented PluginStorePage component for displaying available plugins.
- Added functionality to install and update plugins with user confirmation.
- Integrated plugin store API for fetching plugin data and handling installations.
- Enhanced PluginsPage to navigate to the new Plugin Store.
- Updated localization files for new plugin store strings in English, Russian, and Chinese.
- Added new types for plugin store entries and responses in TypeScript.
- Improved UI components and styles for better user experience in the plugin store.
2026-06-13 01:21:36 +08:00
LTbinglingfeng c7051aeb68 feat(quota): enhance quota reset functionality with UI updates and styling improvements 2026-06-12 17:38:47 +08:00
LTbinglingfeng f3959a0b19 feat(quota): implement manual quota reset functionality with confirmation and UI updates 2026-06-12 17:26:23 +08:00
LTbinglingfeng 67c4041939 feat(quota): add subscription expiry handling and improve UI elements 2026-06-12 17:03:19 +08:00
LTbinglingfeng 4b3daa0010 feat(plugins): enhance plugin logo handling with fallback and improve sidebar layout 2026-06-11 22:36:34 +08:00
LTbinglingfeng 7418fac6be feat(plugins): implement plugin resource management with dynamic routing and UI enhancements 2026-06-11 22:16:51 +08:00
LTbinglingfeng 848eefb6e8 feat(ui): restructure PluginsPage layout with improved styling and new section headers 2026-06-11 21:31:26 +08:00
LTbinglingfeng 947f9f880a feat: add plugin management feature with internationalization support
- Introduced new plugin management section in the application.
- Added translations for English, Russian, Simplified Chinese, and Traditional Chinese.
- Created new API endpoints for managing plugins, including listing, enabling/disabling, and configuring plugins.
- Updated routing to include a dedicated PluginsPage.
- Defined new types for plugin configuration and metadata in TypeScript.
- Enhanced the existing API client to handle plugin-related requests.
2026-06-11 01:45:10 +08:00
LTbinglingfeng 4586b1dec2 feat(logs): enhance error log viewer with open, copy, and download functionalities 2026-06-11 00:14:28 +08:00
LTbinglingfeng 483dad692b feat(uiState): implement provider UI state management with persistence v1.15.3 2026-06-10 18:55:46 +08:00
LTbinglingfeng 7f48799b69 fix(quota): hide duplicate idle card refresh action 2026-06-10 18:49:16 +08:00
LTbinglingfeng fa54b443e6 Merge remote-tracking branch 'origin/pr/311' into dev 2026-06-10 18:48:21 +08:00
LTbinglingfeng bc526a6924 Merge PR #300: feat: add fullscreen logs view v1.15.2 2026-06-10 17:19:46 +08:00
LTbinglingfeng 9c8690865e feat(toolbar): implement provider resource toolbar with sorting and filtering functionality 2026-06-10 16:53:16 +08:00
LTbinglingfeng a04ffb5298 feat(connectivity): add Gemini support and enhance test model handling 2026-06-10 16:33:20 +08:00
LTbinglingfeng 73066b517c feat(i18n): update provider keys detail and add duplicate alias message in multiple locales
feat(authFiles): refactor OAuth provider handling and improve alias validation

feat(config): implement unsaved changes guard in ConfigPage

feat(dashboard): extend provider stats to include vertex and ampcode

fix(logs): enhance incremental log merging and improve error handling

feat(system): format build time display using utility functions

feat(api): normalize OAuth provider keys in authFiles API

feat(provider): update OpenAI provider deletion method to use index

feat(format): add date formatting utilities for better date handling
2026-06-10 16:17:40 +08:00
MarvekG d0bb21000b feat(quota): add card refresh actions 2026-06-05 14:35:01 +00:00
LTbinglingfeng 657e5a82cb feat(provider-sheet): add mutationDisabled prop to control form submission v1.15.1 2026-06-02 22:07:21 +08:00
Chén MùandGitHub 6a567bbbbb Merge pull request #303 from router-for-me:home
feat(logs): enhance logging functionality and UI updates
v1.15.0
2026-06-02 17:32:40 +08:00
hkfires 8eada1cd2c feat(logs): enhance logging functionality and UI updates
- Refactored MainLayout to always show logs in the sidebar.
- Updated i18n files for English, Russian, Simplified Chinese, and Traditional Chinese to include new log-related messages.
- Improved LogsPage styling for better layout and added runtime notices.
- Enhanced LogsPage logic to handle different server runtime kinds (CPA and Home).
- Added new API methods to handle logs fetching and request log downloading with runtime checks.
- Introduced runtime kind detection during authentication and connection status updates.
- Updated types to include server runtime kind and adjusted API responses accordingly.
2026-06-02 16:52:14 +08:00
HYec 60092f3da0 feat: add fullscreen logs view 2026-06-01 16:38:34 +00:00
LTbinglingfeng 75da30311a refactor(forms): streamline imports and improve state handling for API keys v1.14.1 2026-06-01 00:22:09 +08:00
LTbinglingfeng 7c18e4c937 fix(forms): prevent browser autofill for API key fields 2026-06-01 00:01:35 +08:00
LTbinglingfeng 97b2152a81 fix(providers): remove per-key headers input for openai-compatibility
The backend OpenAICompatibilityAPIKey struct only has api-key and
proxy-url (internal/config/config.go:570-577). PUT /openai-compatibility
unmarshals into this struct (config_lists.go:439) and discards any
unknown field, so per-entry headers submitted from the UI never persist
and never reach the runtime request path. The GET response wrapper
also has no headers field (config_auth_index.go:31-34).

Drop the per-entry headers input from BaseProviderForm and the
ApiKeyEntry/ApiKeyEntryInput types. Connectivity test and model
discovery stop reading entry-level headers — they continue to apply
provider-level headers, which is the supported contract.
2026-05-28 01:44:02 +08:00
LTbinglingfeng 7c1b89c09d fix(auth-files): infer counts/names for single-item success path
Backend's POST /auth-files and DELETE /auth-files single-item paths
return only {status:"ok"}, with no uploaded/deleted/files
(auth_files.go:680 and :794). Multi-item paths return the full payload.

85c8b34 simplified the normalizer assuming the full payload was always
present, which caused single-file uploads and single-item deletes to be
read as "0 succeeded" — the upload page skipped its success toast and
list refresh, and batch delete reported "(0)" with no row removal.

Re-introduce a narrow fallback: when failed is empty and the count
field is omitted, derive uploaded/deleted and files from requestedNames.
The fallback only kicks in for the documented single-item shape, not
for the partial/failure paths.
2026-05-28 01:29:38 +08:00
LTbinglingfeng 7f29cf2384 refactor(transformers): tighten normalizeBoolean to accept real booleans only
All bool-tagged config fields on the backend are Go bools and serialize
as JSON true/false (e.g. Debug, RequestLog, WebsocketAuth, Disabled,
Websockets, ForceModelPrefix). normalizeBoolean is only called against
those response paths, so the number / string / Boolean(value) fallbacks
never fire.
2026-05-28 00:41:54 +08:00
LTbinglingfeng 85c8b34e59 refactor(auth-files): simplify batch response and field normalization
Backend batch upload/delete handlers always return a complete payload:
status (string), uploaded/deleted (number), files (string array), and
failed (only on partial). See auth_files.go:702-711. The fallback chains
that re-derived uploaded/deleted counts and file names from the
requestedNames list were unreachable.

Likewise, runtime_only is always a real bool from Go (auth_files.go:403),
and entry.modified is never emitted, so isRuntimeOnlyEntry collapses
to a strict equality check and readDateField drops the modified alias.
2026-05-28 00:41:06 +08:00
LTbinglingfeng fadf2a67b8 refactor(api-call): drop dead statusCode/headers field aliases
The backend api-call response schema (api_tools.go:54-56) fixes the
field names to status_code / header / body. camelCase statusCode and
plural headers are never emitted.
2026-05-28 00:38:47 +08:00
LTbinglingfeng 21e9e983e6 refactor(config): drop dead key aliases in single-field GETs
Backend handlers emit single-field GETs with a single kebab-case key:
- GetLogsMaxTotalSizeMB returns {"logs-max-total-size-mb": n}
  (config_basic.go:206)
- GetForceModelPrefix returns {"force-model-prefix": b}
  (config_basic.go:276)
- GetRoutingStrategy returns {"strategy": s}
  (config_basic.go:295-301)

The camelCase fallbacks (logsMaxTotalSizeMb / forceModelPrefix /
routing-strategy / routingStrategy) were never reachable.
2026-05-28 00:38:01 +08:00
LTbinglingfeng 5a69c8c9b6 refactor(providers): simplify section and array payload extraction
Backend list endpoints (config_lists.go: GetGeminiKeys / GetClaudeKeys /
GetCodexKeys / GetOpenAICompat / GetVertexCompatKeys) always wrap the
result as {"<kebab-section>": [...]}, never as a raw array, never under
"items" or "data". And /config emits the same kebab keys, so the camelCase
aliases (geminiApiKey, openAICompatibility, ...) are unreachable.

Remove RAW_SECTION_ALIASES and inline the lookup; drop the raw-array
and items/data fallbacks from extractArrayPayload.
2026-05-28 00:36:50 +08:00
LTbinglingfeng 21c2abfe64 refactor(providers): trim provider field allowlists to kebab-case
The backend emits provider config with kebab-case JSON tags only
(internal/config/config.go: ClaudeKey/CodexKey/GeminiKey/OpenAICompatibility,
internal/api/handlers/management/config_auth_index.go for auth-index).
The camelCase / snake_case entries in PROVIDER_KEY_FIELDS,
OPENAI_PROVIDER_FIELDS, MODEL_ALIAS_FIELDS, API_KEY_ENTRY_FIELDS,
CLOAK_FIELDS, RESPONSE_ONLY_FIELDS were dead — same for the identity
helpers and the apiKeyEntries fallback in mergeOpenAIProviderPayload.
2026-05-28 00:35:23 +08:00
LTbinglingfeng 12dfd73dc8 refactor(transformers): drop kebab/camel/snake aliases in /config parsing
The backend always serializes config fields with kebab-case JSON tags
(internal/config/config.go). The camelCase and snake_case fallbacks in
normalizeApiKeyEntry / normalizeProviderKeyConfig / normalizeGeminiKeyConfig /
normalizeOpenAIProvider / normalizeAmpcode* / normalizeConfigResponse are
dead paths. Read kebab-case only.

The legacy openai-compatibility `api-keys` (flat string array) flat-string
branch is also gone — backend startup migration is disabled
(internal/config/config.go:657).
2026-05-28 00:33:05 +08:00
LTbinglingfeng 71d7c39644 fix(providers): keep api key visibility aligned after removal 2026-05-28 00:00:19 +08:00
LTbinglingfeng 0f27e3cd69 Merge remote-tracking branch 'origin/pr/292' into dev
# Conflicts:
#	src/features/providers/sheets/forms/BaseProviderForm.tsx
2026-05-27 23:45:21 +08:00