fix: 模型管理中禁用ReRank模型Ollama选项并添加提示信息
This commit is contained in:
@@ -25,15 +25,21 @@
|
|||||||
<t-radio-group v-model="formData.source">
|
<t-radio-group v-model="formData.source">
|
||||||
<t-radio
|
<t-radio
|
||||||
value="local"
|
value="local"
|
||||||
:disabled="ollamaServiceStatus === false"
|
:disabled="ollamaServiceStatus === false || modelType === 'rerank'"
|
||||||
>
|
>
|
||||||
{{ $t('model.editor.sourceLocal') }}
|
{{ $t('model.editor.sourceLocal') }}
|
||||||
</t-radio>
|
</t-radio>
|
||||||
<t-radio value="remote">{{ $t('model.editor.sourceRemote') }}</t-radio>
|
<t-radio value="remote">{{ $t('model.editor.sourceRemote') }}</t-radio>
|
||||||
</t-radio-group>
|
</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不可用时的提示信息 -->
|
<!-- 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" />
|
<t-icon name="error-circle-filled" class="tip-icon" />
|
||||||
<span class="tip-text">{{ $t('model.editor.ollamaUnavailable') }}</span>
|
<span class="tip-text">{{ $t('model.editor.ollamaUnavailable') }}</span>
|
||||||
<t-button
|
<t-button
|
||||||
@@ -415,6 +421,11 @@ watch(() => props.visible, (val) => {
|
|||||||
} else {
|
} else {
|
||||||
resetForm()
|
resetForm()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReRank 模型强制使用 remote 来源(Ollama 不支持 ReRank)
|
||||||
|
if (props.modelType === 'rerank') {
|
||||||
|
formData.value.source = 'remote'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 恢复背景滚动
|
// 恢复背景滚动
|
||||||
document.body.style.overflow = ''
|
document.body.style.overflow = ''
|
||||||
@@ -1314,6 +1325,10 @@ const handleCancel = () => {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
|
|
||||||
|
&.info {
|
||||||
|
color: #07C05F;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tip-text {
|
.tip-text {
|
||||||
@@ -1322,6 +1337,17 @@ const handleCancel = () => {
|
|||||||
line-height: 1.5;
|
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) {
|
:deep(.tip-link) {
|
||||||
color: #07C05F;
|
color: #07C05F;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@@ -1407,6 +1407,7 @@ export default {
|
|||||||
downloadFailed: 'Failed to download {name}',
|
downloadFailed: 'Failed to download {name}',
|
||||||
downloadStartFailed: 'Failed to start download',
|
downloadStartFailed: 'Failed to start download',
|
||||||
ollamaUnavailable: 'Ollama service is unavailable, local models cannot be selected',
|
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',
|
goToOllamaSettings: 'Open Settings',
|
||||||
validation: {
|
validation: {
|
||||||
modelNameRequired: 'Please enter the model name',
|
modelNameRequired: 'Please enter the model name',
|
||||||
|
|||||||
@@ -877,6 +877,7 @@ export default {
|
|||||||
downloadFailed: 'Не удалось загрузить {name}',
|
downloadFailed: 'Не удалось загрузить {name}',
|
||||||
downloadStartFailed: 'Не удалось запустить загрузку',
|
downloadStartFailed: 'Не удалось запустить загрузку',
|
||||||
ollamaUnavailable: 'Сервис Ollama недоступен, локальные модели недоступны для выбора',
|
ollamaUnavailable: 'Сервис Ollama недоступен, локальные модели недоступны для выбора',
|
||||||
|
ollamaNotSupportRerank: 'Ollama не поддерживает модели ReRank, используйте удалённый API',
|
||||||
goToOllamaSettings: 'Открыть настройки',
|
goToOllamaSettings: 'Открыть настройки',
|
||||||
validation: {
|
validation: {
|
||||||
modelNameRequired: 'Введите название модели',
|
modelNameRequired: 'Введите название модели',
|
||||||
|
|||||||
@@ -969,6 +969,7 @@ export default {
|
|||||||
downloadFailed: "{name} 下载失败",
|
downloadFailed: "{name} 下载失败",
|
||||||
downloadStartFailed: "启动下载失败",
|
downloadStartFailed: "启动下载失败",
|
||||||
ollamaUnavailable: "Ollama服务不可用,无法选择本地模型",
|
ollamaUnavailable: "Ollama服务不可用,无法选择本地模型",
|
||||||
|
ollamaNotSupportRerank: "Ollama 不支持 ReRank 模型,请使用远程接口配置",
|
||||||
goToOllamaSettings: "查看设置",
|
goToOllamaSettings: "查看设置",
|
||||||
validation: {
|
validation: {
|
||||||
modelNameRequired: "请输入模型名称",
|
modelNameRequired: "请输入模型名称",
|
||||||
|
|||||||
Reference in New Issue
Block a user