mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 08:44:41 +08:00
feat(opencode): add manual provider key input with duplicate check
- Add Provider Key input field for OpenCode providers (between icon and name) - User must manually enter a unique key instead of auto-generating from name - Real-time validation: format check and duplicate detection - Key is immutable after creation (disabled in edit mode) - Remove slugify auto-generation logic from mutations - Add beforeNameSlot prop to BasicFormFields for extensibility - Add i18n translations for zh/en/ja
This commit is contained in:
@@ -54,7 +54,7 @@ export function useProviderActions(activeApp: AppId) {
|
||||
|
||||
// 添加供应商
|
||||
const addProvider = useCallback(
|
||||
async (provider: Omit<Provider, "id">) => {
|
||||
async (provider: Omit<Provider, "id"> & { providerKey?: string }) => {
|
||||
await addProviderMutation.mutateAsync(provider);
|
||||
},
|
||||
[addProviderMutation],
|
||||
|
||||
Reference in New Issue
Block a user