From ee7b149381169a8ff993124d84f9e25100c9e280 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sat, 8 Nov 2025 20:59:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=B7=AF=E7=94=B1=E5=92=8C=E4=BF=A1=E6=81=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 `get_default_info_config` 函数,简化信息配置加载逻辑。 - 在 `info.template.yaml` 中更新品牌信息和功能特性,添加新的统计信息和操作链接。 - 修改 `HomeView.vue` 以支持新的功能特性和操作链接展示,优化页面布局和样式。 - 删除过时的 `models.yaml` 文件,集中管理模型配置。 --- server/routers/system_router.py | 17 +- src/config/static/info.template.yaml | 41 +- src/config/static/models.yaml | 150 ------- web/src/stores/info.js | 47 ++- web/src/views/HomeView.vue | 607 ++++++++++++++++----------- 5 files changed, 442 insertions(+), 420 deletions(-) delete mode 100644 src/config/static/models.yaml diff --git a/server/routers/system_router.py b/server/routers/system_router.py index 493ecb38..5c57fc5b 100644 --- a/server/routers/system_router.py +++ b/server/routers/system_router.py @@ -99,22 +99,7 @@ def load_info_config(): except Exception as e: logger.error(f"Failed to load info config: {e}") - return get_default_info_config() - - -def get_default_info_config(): - """获取默认信息配置""" - return { - "organization": {"name": "江南语析", "logo": "/favicon.svg", "avatar": "/avatar.jpg"}, - "branding": { - "name": "Yuxi-Know", - "title": "Yuxi-Know", - "subtitle": "大模型驱动的知识库管理工具", - "description": "结合知识库与知识图谱,提供更准确、更全面的回答", - }, - "features": ["📚 灵活知识库", "🕸️ 知识图谱集成", "🤖 多模型支持"], - "footer": {"copyright": "© 江南语析 2025 [WIP] v0.3.0"}, - } + return {} @system.get("/info") diff --git a/src/config/static/info.template.yaml b/src/config/static/info.template.yaml index 602dea1a..d13f6c77 100644 --- a/src/config/static/info.template.yaml +++ b/src/config/static/info.template.yaml @@ -11,15 +11,42 @@ organization: # 项目信息 branding: name: "Yuxi-Know" - title: "Yuxi-Know: 更智能的知识库管理工具" # 系统标题 - subtitle: "大模型驱动的知识库管理工具" # 副标题 - description: "结合知识库与知识图谱,提供更准确、更全面的回答" # 描述信息 + title: "Yuxi-Know: 更智能的知识库智能体平台" # 系统标题 + subtitle: "大模型驱动的知识库智能体平台" # 副标题 -# 功能特性 features: - - "📚 灵活知识库" - - "🕸️ 知识图谱集成" - - "🤖 权限隔离" + - label: "GitHub Stars" + value: "2300+" + description: "开发者社区的认可与支持" + icon: "stars" + - label: "已解决 Issues" + value: "200+" + description: "持续改进和问题解决能力" + icon: "issues" + - label: "累计 Commits" + value: "1000+" + description: "活跃的开发迭代和功能更新" + icon: "commits" + - label: "开源协议" + value: "MIT 协议" + description: "完全免费,支持商业使用" + icon: "license" + +actions: + - name: "演示视频" + icon: "video" + url: "https://www.bilibili.com/video/BV1DF14BTETq" + - name: "文档中心" + icon: "docs" + url: "https://xerrors.github.io/Yuxi-Know/" + - name: "提交 Issue" + icon: "issue" + url: "https://github.com/xerrors/Yuxi-Know/issues/new/choose" + - name: "开发路线图" + icon: "roadmap" + url: "https://xerrors.github.io/Yuxi-Know/latest/changelog/roadmap.html" + + # 页脚信息 footer: diff --git a/src/config/static/models.yaml b/src/config/static/models.yaml deleted file mode 100644 index 947ed39a..00000000 --- a/src/config/static/models.yaml +++ /dev/null @@ -1,150 +0,0 @@ -################################################################################## -# -# 注意:本文件已弃用,现在模型的默认配置在 src/config/static/models.py 中定义 -# 修改后的配置信息,保存在 saves/config/base.toml 中 -# -################################################################################### - -# MODEL_NAMES: -# openai: -# name: OpenAI -# url: https://platform.openai.com/docs/models -# base_url: https://api.openai.com/v1 -# default: gpt-4o-mini -# env: OPENAI_API_KEY -# models: -# - gpt-4 -# - gpt-4o -# - gpt-4o-mini - -# deepseek: -# name: DeepSeek -# url: https://platform.deepseek.com/api-docs/zh-cn/pricing -# base_url: https://api.deepseek.com/v1 -# default: deepseek-chat -# env: DEEPSEEK_API_KEY -# models: -# - deepseek-chat -# - deepseek-reasoner - -# zhipu: -# name: 智谱AI (Zhipu) -# url: https://open.bigmodel.cn/dev/api -# base_url: https://open.bigmodel.cn/api/paas/v4/ -# default: glm-4.5-flash -# env: ZHIPUAI_API_KEY -# models: -# - glm-4.6 -# - glm-4.5-air -# - glm-4.5-flash - -# siliconflow: -# name: SiliconFlow -# url: https://cloud.siliconflow.cn/models -# base_url: https://api.siliconflow.cn/v1 -# default: Qwen/Qwen3-32B -# env: SILICONFLOW_API_KEY -# models: -# - Qwen/Qwen3-Next-80B-A3B-Thinking -# - Qwen/Qwen3-32B -# - deepseek-ai/DeepSeek-V3.2-Exp -# - Qwen/Qwen3-235B-A22B-Thinking-2507 -# - Qwen/Qwen3-235B-A22B-Instruct-2507 -# - moonshotai/Kimi-K2-Instruct-0905 -# - zai-org/GLM-4.6 - -# together.ai: -# name: Together.ai -# url: https://api.together.ai/models -# base_url: https://api.together.xyz/v1/ -# default: meta-llama/Llama-3.3-70B-Instruct-Turbo-Free -# env: TOGETHER_API_KEY -# models: -# - meta-llama/Llama-3.3-70B-Instruct-Turbo-Free - -# dashscope: -# name: 阿里百炼 (DashScope) -# url: https://bailian.console.aliyun.com/?switchAgent=10226727&productCode=p_efm#/model-market -# base_url: https://dashscope.aliyuncs.com/compatible-mode/v1 -# default: qwen-max-latest -# env: DASHSCOPE_API_KEY -# models: -# - qwen-max-latest -# - qwen-plus-latest -# - qwen-turbo-latest -# - qwen3-235b-a22b-thinking-2507 -# - qwen3-235b-a22b-instruct-2507 - -# ark: -# name: 豆包(Ark) -# url: https://console.volcengine.com/ark/region:ark+cn-beijing/model -# base_url: https://ark.cn-beijing.volces.com/api/v3 -# default: doubao-seed-1-6-250615 -# env: ARK_API_KEY -# models: -# - doubao-seed-1-6-250615 -# - doubao-seed-1-6-thinking-250715 -# - doubao-seed-1-6-flash-250715 - -# openrouter: -# name: OpenRouter -# url: https://openrouter.ai/models -# base_url: https://openrouter.ai/api/v1 -# default: openai/gpt-4o -# env: OPENROUTER_API_KEY -# models: -# - openai/gpt-4o -# - x-ai/grok-4 -# - google/gemini-2.5-pro -# - anthropic/claude-sonnet-4 - -# EMBED_MODEL_INFO: -# siliconflow/Pro/BAAI/bge-m3: -# name: Pro/BAAI/bge-m3 -# dimension: 1024 -# base_url: https://api.siliconflow.cn/v1/embeddings -# api_key: SILICONFLOW_API_KEY - -# siliconflow/BAAI/bge-m3: -# name: BAAI/bge-m3 -# dimension: 1024 -# base_url: https://api.siliconflow.cn/v1/embeddings -# api_key: SILICONFLOW_API_KEY - -# siliconflow/Qwen/Qwen3-Embedding-0.6B: -# name: Qwen/Qwen3-Embedding-0.6B -# dimension: 1024 -# base_url: https://api.siliconflow.cn/v1/embeddings -# api_key: SILICONFLOW_API_KEY - -# vllm/Qwen/Qwen3-Embedding-0.6B: -# name: Qwen3-Embedding-0.6B -# dimension: 1024 -# base_url: http://localhost:8000/v1/embeddings -# api_key: no_api_key - -# ollama/nomic-embed-text: -# name: nomic-embed-text -# base_url: http://localhost:11434/api/embed -# dimension: 768 - -# ollama/bge-m3: -# name: bge-m3 -# base_url: http://localhost:11434/api/embed -# dimension: 1024 - -# RERANKER_LIST: -# siliconflow/Pro/BAAI/bge-reranker-v2-m3: -# name: Pro/BAAI/bge-reranker-v2-m3 -# base_url: https://api.siliconflow.cn/v1/rerank -# api_key: SILICONFLOW_API_KEY - -# siliconflow/BAAI/bge-reranker-v2-m3: -# name: BAAI/bge-reranker-v2-m3 -# base_url: https://api.siliconflow.cn/v1/rerank -# api_key: SILICONFLOW_API_KEY - -# vllm/BAAI/bge-reranker-v2-m3: -# name: BAAI/bge-reranker-v2-m3 -# base_url: http://localhost:8000/v1/rerank -# api_key: no_api_key diff --git a/web/src/stores/info.js b/web/src/stores/info.js index 844b3a7d..643865a9 100644 --- a/web/src/stores/info.js +++ b/web/src/stores/info.js @@ -25,11 +25,45 @@ export const useInfoStore = defineStore('info', () => { }) // 计算属性 - 功能特性 - const features = computed(() => infoConfig.value.features || [ - "📚 灵活知识库", - "🕸️ 知识图谱集成", - "🤖 多模型支持" - ]) + const features = computed(() => infoConfig.value.features || [{ + label: "GitHub Stars", + value: "2300+", + description: "开发者社区的认可与支持", + icon: "stars" + }, { + label: "已解决 Issues", + value: "200+", + description: "持续改进和问题解决能力", + icon: "issues" + }, { + label: "累计 Commits", + value: "1000+", + description: "活跃的开发迭代和功能更新", + icon: "commits" + }, { + label: "开源协议", + value: "MIT 协议", + description: "完全免费,支持商业使用", + icon: "license" + }]) + + const actions = computed(() => infoConfig.value.actions || [{ + name: "演示视频", + icon: "video", + url: "https://www.bilibili.com/video/BV1DF14BTETq" + }, { + name: "文档中心", + icon: "docs", + url: "https://xerrors.github.io/Yuxi-Know/" + }, { + name: "提交 Issue", + icon: "issue", + url: "https://github.com/xerrors/Yuxi-Know/issues/new/choose" + }, { + name: "开发路线图", + icon: "roadmap", + url: "https://github.com/xerrors/Yuxi-Know#roadmap" + }]) // 计算属性 - 页脚信息 const footer = computed(() => infoConfig.value.footer || { @@ -109,6 +143,7 @@ export const useInfoStore = defineStore('info', () => { branding, features, footer, + actions, // 方法 setInfoConfig, @@ -117,4 +152,4 @@ export const useInfoStore = defineStore('info', () => { loadInfoConfig, reloadInfoConfig } -}) \ No newline at end of file +}) diff --git a/web/src/views/HomeView.vue b/web/src/views/HomeView.vue index 18e55fb4..9f090f4b 100644 --- a/web/src/views/HomeView.vue +++ b/web/src/views/HomeView.vue @@ -1,16 +1,10 @@