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:
Jason
2026-01-17 20:28:11 +08:00
parent ad6f5b388b
commit 5bcf5bf382
8 changed files with 142 additions and 27 deletions
+1 -1
View File
@@ -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],