diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index dca8389d..1617f89d 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -1,6 +1,6 @@
-
+
基本设置 模型配置 路径配置
-
+

基础模型配置

-
+
{{ items?.embed_model.des }}
-
+
{{ items?.reranker.des }}

检索配置

-
+
{{ items?.use_rewrite_query.des }}
-
+

模型配置

请在 src/.env 文件中配置对应的 APIKEY

@@ -184,7 +184,7 @@
-
+

本地模型配置

如果是 Docker 启动,务必确保在环境变量中设置了 MODEL_DIR,或者设置了 volumes 映射

import { message } from 'ant-design-vue'; -import { computed, reactive, ref, h, watch } from 'vue' +import { computed, reactive, ref, h, watch, onMounted, onUnmounted } from 'vue' import { useConfigStore } from '@/stores/config'; import { ReloadOutlined, @@ -231,16 +231,17 @@ const customModel = reactive({ }) const state = reactive({ loading: false, - section: 'base' + section: 'base', + windowWidth: window?.innerWidth || 0 }) // 筛选 modelStatus 中为真的key const modelKeys = computed(() => { - return Object.keys(modelStatus.value).filter(key => modelStatus.value[key]) + return Object.keys(modelStatus.value || {}).filter(key => modelStatus.value?.[key]) }) const notModelKeys = computed(() => { - return Object.keys(modelStatus.value).filter(key => !modelStatus.value[key]) + return Object.keys(modelStatus.value || {}).filter(key => !modelStatus.value?.[key]) }) const generateRandomHash = (length) => { @@ -360,6 +361,19 @@ const handleCancelCustomModel = () => { customModel.visible = false } +const updateWindowWidth = () => { + state.windowWidth = window?.innerWidth || 0 +} + +onMounted(() => { + updateWindowWidth() + window.addEventListener('resize', updateWindowWidth) +}) + +onUnmounted(() => { + window.removeEventListener('resize', updateWindowWidth) +}) + const sendRestart = () => { console.log('Restarting...') message.loading({ content: '重新加载模型中', key: "restart", duration: 0 }); @@ -618,7 +632,18 @@ const sendRestart = () => { } } +} +@media (max-width: 520px) { + .setting-container { + flex-direction: column; + } + + .card.card-select { + gap: 0.75rem; + align-items: flex-start; + flex-direction: column; + } }