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
+7 -1
View File
@@ -475,7 +475,13 @@
"addModel": "Add Model",
"modelId": "Model ID",
"modelName": "Display Name",
"noModels": "No models configured"
"noModels": "No models configured",
"providerKey": "Provider Key",
"providerKeyPlaceholder": "my-provider",
"providerKeyHint": "Unique identifier in config file. Cannot be changed after creation. Use lowercase letters, numbers, and hyphens only.",
"providerKeyRequired": "Provider key is required",
"providerKeyDuplicate": "This key is already in use",
"providerKeyInvalid": "Invalid format. Use lowercase letters, numbers, and hyphens only."
},
"providerPreset": {
"label": "Provider Preset",
+7 -1
View File
@@ -475,7 +475,13 @@
"addModel": "モデルを追加",
"modelId": "モデル ID",
"modelName": "表示名",
"noModels": "モデルが設定されていません"
"noModels": "モデルが設定されていません",
"providerKey": "プロバイダーキー",
"providerKeyPlaceholder": "my-provider",
"providerKeyHint": "設定ファイルの一意の識別子。作成後は変更できません。小文字、数字、ハイフンのみ使用できます。",
"providerKeyRequired": "プロバイダーキーを入力してください",
"providerKeyDuplicate": "このキーは既に使用されています",
"providerKeyInvalid": "無効な形式です。小文字、数字、ハイフンのみ使用できます。"
},
"providerPreset": {
"label": "プロバイダータイプ",
+7 -1
View File
@@ -475,7 +475,13 @@
"addModel": "添加模型",
"modelId": "模型 ID",
"modelName": "显示名称",
"noModels": "暂无模型配置"
"noModels": "暂无模型配置",
"providerKey": "供应商标识",
"providerKeyPlaceholder": "my-provider",
"providerKeyHint": "配置文件中的唯一标识符,创建后无法修改,只能使用小写字母、数字和连字符",
"providerKeyRequired": "请填写供应商标识",
"providerKeyDuplicate": "此标识已被使用,请更换",
"providerKeyInvalid": "标识格式无效,只能使用小写字母、数字和连字符"
},
"providerPreset": {
"label": "预设供应商",