fix: 模型管理中禁用ReRank模型Ollama选项并添加提示信息

This commit is contained in:
wizardchen
2025-12-18 10:49:45 +08:00
committed by lyingbug
parent 6b7558c559
commit 7576f08ad5
4 changed files with 31 additions and 2 deletions
+28 -2
View File
@@ -25,15 +25,21 @@
<t-radio-group v-model="formData.source">
<t-radio
value="local"
:disabled="ollamaServiceStatus === false"
:disabled="ollamaServiceStatus === false || modelType === 'rerank'"
>
{{ $t('model.editor.sourceLocal') }}
</t-radio>
<t-radio value="remote">{{ $t('model.editor.sourceRemote') }}</t-radio>
</t-radio-group>
<!-- ReRank模型不支持Ollama的提示信息 -->
<div v-if="modelType === 'rerank'" class="ollama-unavailable-tip rerank-tip">
<t-icon name="info-circle-filled" class="tip-icon info" />
<span class="tip-text">{{ $t('model.editor.ollamaNotSupportRerank') }}</span>
</div>
<!-- Ollama不可用时的提示信息 -->
<div v-if="ollamaServiceStatus === false" class="ollama-unavailable-tip">
<div v-else-if="ollamaServiceStatus === false" class="ollama-unavailable-tip">
<t-icon name="error-circle-filled" class="tip-icon" />
<span class="tip-text">{{ $t('model.editor.ollamaUnavailable') }}</span>
<t-button
@@ -415,6 +421,11 @@ watch(() => props.visible, (val) => {
} else {
resetForm()
}
// ReRank 模型强制使用 remote 来源(Ollama 不支持 ReRank)
if (props.modelType === 'rerank') {
formData.value.source = 'remote'
}
} else {
// 恢复背景滚动
document.body.style.overflow = ''
@@ -1314,6 +1325,10 @@ const handleCancel = () => {
font-size: 16px;
flex-shrink: 0;
margin-right: 2px;
&.info {
color: #07C05F;
}
}
.tip-text {
@@ -1322,6 +1337,17 @@ const handleCancel = () => {
line-height: 1.5;
}
// ReRank提示使用主题绿色风格,与主页面保持一致
&.rerank-tip {
background: #f0fdf6;
border: 1px solid #d1fae5;
border-left: 3px solid #07C05F;
.tip-text {
color: #166534;
}
}
:deep(.tip-link) {
color: #07C05F;
font-size: 13px;
+1
View File
@@ -1407,6 +1407,7 @@ export default {
downloadFailed: 'Failed to download {name}',
downloadStartFailed: 'Failed to start download',
ollamaUnavailable: 'Ollama service is unavailable, local models cannot be selected',
ollamaNotSupportRerank: 'Ollama does not support ReRank models, please use a remote API instead',
goToOllamaSettings: 'Open Settings',
validation: {
modelNameRequired: 'Please enter the model name',
+1
View File
@@ -877,6 +877,7 @@ export default {
downloadFailed: 'Не удалось загрузить {name}',
downloadStartFailed: 'Не удалось запустить загрузку',
ollamaUnavailable: 'Сервис Ollama недоступен, локальные модели недоступны для выбора',
ollamaNotSupportRerank: 'Ollama не поддерживает модели ReRank, используйте удалённый API',
goToOllamaSettings: 'Открыть настройки',
validation: {
modelNameRequired: 'Введите название модели',
+1
View File
@@ -969,6 +969,7 @@ export default {
downloadFailed: "{name} 下载失败",
downloadStartFailed: "启动下载失败",
ollamaUnavailable: "Ollama服务不可用,无法选择本地模型",
ollamaNotSupportRerank: "Ollama 不支持 ReRank 模型,请使用远程接口配置",
goToOllamaSettings: "查看设置",
validation: {
modelNameRequired: "请输入模型名称",