Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
fix(model): hide Ollama tip for remote models
wolfkill5a81441637bd
diff --git a/frontend/src/components/ModelEditorDialog.vue b/frontend/src/components/ModelEditorDialog.vueindex b22560466..df8b45f18 100644--- a/frontend/src/components/ModelEditorDialog.vue+++ b/frontend/src/components/ModelEditorDialog.vue@@ -30,7 +30,10 @@</div><!-- Ollama不可用时的提示信息 -->- <div v-else-if="ollamaServiceStatus === false" class="ollama-unavailable-tip">+ <div+ v-else-if="shouldShowOllamaUnavailableTip(formData.source, modelType, ollamaServiceStatus)"+ class="ollama-unavailable-tip"+ ><t-icon name="error-circle-filled" class="tip-icon" /><span class="tip-text">{{ $t('model.editor.ollamaUnavailable') }}</span><t-button@@ -334,6 +337,7 @@ import { getWeKnoraCloudStatus } from '@/api/model'import { useI18n } from 'vue-i18n'import { useUIStore } from '@/stores/ui'import SettingDrawer from '@/components/settings/SettingDrawer.vue'+import { shouldShowOllamaUnavailableTip } from '@/components/modelEditorSourceState'interface CustomHeaderItem {key: stringdiff --git a/frontend/src/components/modelEditorSourceState.test.ts b/frontend/src/components/modelEditorSourceState.test.tsnew file mode 100644index 000000000..39ba7ddf3--- /dev/null+++ b/frontend/src/components/modelEditorSourceState.test.ts@@ -0,0 +1,19 @@+import assert from 'node:assert/strict'+import test from 'node:test'++import { shouldShowOllamaUnavailableTip } from './modelEditorSourceState.ts'++test('hides Ollama unavailable tip while configuring a remote model', () => {+ assert.equal(shouldShowOllamaUnavailableTip('remote', 'chat', false), false)+})++test('shows Ollama unavailable tip only for local non-rerank models', () => {+ assert.equal(shouldShowOllamaUnavailableTip('local', 'chat', false), true)+ assert.equal(shouldShowOllamaUnavailableTip('local', 'embedding', false), true)+ assert.equal(shouldShowOllamaUnavailableTip('local', 'rerank', false), false)+})++test('does not show Ollama unavailable tip before status is known or when Ollama is available', () => {+ assert.equal(shouldShowOllamaUnavailableTip('local', 'chat', null), false)+ assert.equal(shouldShowOllamaUnavailableTip('local', 'chat', true), false)+})diff --git a/frontend/src/components/modelEditorSourceState.ts b/frontend/src/components/modelEditorSourceState.tsnew file mode 100644index 000000000..11afbadf4--- /dev/null+++ b/frontend/src/components/modelEditorSourceState.ts@@ -0,0 +1,11 @@+export type ModelEditorSource = 'local' | 'remote'++export type ModelEditorType = 'chat' | 'embedding' | 'rerank' | 'vllm' | 'asr'++export function shouldShowOllamaUnavailableTip(+ source: ModelEditorSource,+ modelType: ModelEditorType,+ ollamaServiceStatus: boolean | null,+): boolean {+ return source === 'local' && modelType !== 'rerank' && ollamaServiceStatus === false+}