diff --git a/CHANGELOG.md b/CHANGELOG.md index b1e65a85498394db516bcca5dcbef11c1f160bf7..81c5d40008dbea54e729f88880131e54794182bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## [Unreleased] +### 修复 + +- 渠道编辑的“可用模型”把第 9 个及之后的模型折叠成 `+2`,这个标签点不开也删不掉;下拉里又没有任何选项,只显示“无数据”,这些模型既看不到也改不了。现在已选模型全部显示为带删除按钮的标签,下拉列出拉取过的和渠道已配置的模型,可直接勾选取消,也仍可输入新模型名回车添加。 + ## [0.6.2] - 2026-11-14 ### 修复 diff --git a/frontend/src/i18n/messages.ts b/frontend/src/i18n/messages.ts index 8cf613706eddad4a4ce2b08f8e5dc63ca206c997..3d9b0ebe6226857738b11a36f6d08d5471e30726 100644 --- a/frontend/src/i18n/messages.ts +++ b/frontend/src/i18n/messages.ts @@ -380,7 +380,7 @@ export const en = { 'channels.apiKeyOptional': 'Optional for self-hosted services', 'channels.apiKeyHint': 'One key per line. Multiple keys rotate; a rate-limited key pauses automatically. Stored encrypted.', 'channels.keyPool': 'Keys {ready}/{total} ready', - 'channels.modelsHint': 'Fetch from /models, or type a model name and press Enter', + 'channels.modelsHint': 'Fetch from /models, or type a model name and press Enter. Remove a model by unchecking it in the list or clicking × on its tag.', 'channels.modelsPlaceholder': 'Enter a model name and press Enter', 'channels.fetch': 'Fetch', 'channels.mapping': 'Model Mapping', @@ -1192,7 +1192,7 @@ export const zh: Record = { 'channels.apiKeyOptional': '自建服务可以留空', 'channels.apiKeyHint': '每行一个 Key,多个 Key 轮流使用,被限流的自动暂停。加密保存。', 'channels.keyPool': 'Key 可用 {ready}/{total}', - 'channels.modelsHint': '从 /models 拉取,或输入模型名后回车', + 'channels.modelsHint': '从 /models 拉取,或输入模型名后回车;下拉里取消勾选,或点标签上的 × 即可移除模型', 'channels.modelsPlaceholder': '输入模型名后回车', 'channels.fetch': '拉取', 'channels.mapping': '模型映射', diff --git a/frontend/src/views/Channels.vue b/frontend/src/views/Channels.vue index ee539e36ba4f1f315774c90e9b81c956de799f27..3f1213766389f7a6e9f0648264de3f4375922208 100644 --- a/frontend/src/views/Channels.vue +++ b/frontend/src/views/Channels.vue @@ -145,11 +145,11 @@ filterable allow-create default-first-option - collapse-tags - :max-collapse-tags="8" :placeholder="t('channels.modelsPlaceholder')" class="grow" - /> + > + + {{ t('channels.fetch') }}
{{ t('channels.modelsHint') }}
@@ -293,6 +293,9 @@ const emptyForm = () => ({ }) const form = ref(emptyForm()) const enabledCount = computed(() => channels.value.filter(channel => channel.is_enabled).length) +/** Candidate models for the picker: fetched from upstream plus the ones already configured on this channel. */ +const fetchedModels = ref([]) +const modelOptions = computed(() => [...new Set([...fetchedModels.value, ...form.value.models])]) const pricingModelOptions = computed(() => [ ...new Set([...form.value.models, ...mappingRows.value.map(row => row.to.trim()).filter(Boolean)]), ]) @@ -417,6 +420,7 @@ async function fetchModels() { added++ } } + fetchedModels.value = [...new Set([...fetchedModels.value, ...res.models])] ElMessage.success(t('channels.fetched', { count: res.models.length, added })) } catch (error) { ElMessage.error(apiError(error, t('channels.fetchFailed'))) @@ -428,6 +432,7 @@ async function fetchModels() { function openCreate() { editingId.value = null form.value = emptyForm() + fetchedModels.value = [] loadRows({}, {}) dialogVisible.value = true } @@ -441,6 +446,7 @@ function openEdit(row: any) { model_mapping: { ...row.model_mapping }, price_overrides: { ...row.price_overrides }, } + fetchedModels.value = [...row.models] loadRows(form.value.model_mapping, form.value.price_overrides) dialogVisible.value = true }