diff --git a/frontend/src/components/Input-field.vue b/frontend/src/components/Input-field.vue index 665bfbbf..609fab72 100644 --- a/frontend/src/components/Input-field.vue +++ b/frontend/src/components/Input-field.vue @@ -100,6 +100,15 @@ const onKeydown = (val: string, event: { e: { preventDefault(): unknown; keyCode } } +const handleGoToAgentSettings = () => { + // 使用 uiStore 打开设置并跳转到 agent 部分 + uiStore.openSettings('agent'); + // 如果当前不在设置页面,导航到设置页面 + if (route.path !== '/platform/settings') { + router.push('/platform/settings'); + } +} + const toggleAgentMode = () => { // 如果要启用 Agent,先检查是否就绪 // 注意:isAgentReady 是从 store 中计算的,需要确保 store 中的配置是最新的 @@ -114,12 +123,7 @@ const toggleAgentMode = () => { href: '#', onClick: (e: Event) => { e.preventDefault(); - // 使用 uiStore 打开设置并跳转到 agent 部分 - uiStore.openSettings('agent'); - // 如果当前不在设置页面,导航到设置页面 - if (route.path !== '/platform/settings') { - router.push('/platform/settings'); - } + handleGoToAgentSettings(); }, style: 'color: #07C05F; text-decoration: none; font-weight: 500; cursor: pointer; white-space: nowrap; flex-shrink: 0;', onMouseenter: (e: Event) => { @@ -169,9 +173,26 @@ onBeforeRouteUpdate((to, from, next) => {
+
@@ -642,14 +642,14 @@ watch(() => formData.value.modelName, async (newValue, oldValue) => { // 处理下载逻辑 if (newValue.startsWith('__download__')) { - // 提取模型名称 - const modelName = newValue.replace('__download__', '') - - // 重置选择(避免显示 __download__ 前缀) - formData.value.modelName = '' - - // 开始下载 - await startDownload(modelName) + // 提取模型名称 + const modelName = newValue.replace('__download__', '') + + // 重置选择(避免显示 __download__ 前缀) + formData.value.modelName = '' + + // 开始下载 + await startDownload(modelName) return } diff --git a/frontend/src/components/UserMenu.vue b/frontend/src/components/UserMenu.vue index 5020c88b..17069c52 100644 --- a/frontend/src/components/UserMenu.vue +++ b/frontend/src/components/UserMenu.vue @@ -24,10 +24,6 @@ Ollama
-