From 03bb2d89063d1d5571993c19477a21c58d9f76be Mon Sep 17 00:00:00 2001 From: tanlianwang Date: Wed, 4 Mar 2026 14:33:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(layout):=20=E5=8A=A0=E4=B8=8A=E6=80=9D?= =?UTF-8?q?=E7=BB=B4=E5=AF=BC=E5=9B=BE=E4=BE=A7=E8=BE=B9=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check_config.py | 66 ++++++++++++++++++++++ ui/src/layout/components/sidebar/index.vue | 14 +++-- ui/src/router/modules/mindmap.ts | 28 +++++++++ ui/src/views/mindmap/index.vue | 21 +++++++ 4 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 check_config.py create mode 100644 ui/src/router/modules/mindmap.ts create mode 100644 ui/src/views/mindmap/index.vue diff --git a/check_config.py b/check_config.py new file mode 100644 index 000000000..7f9edeadd --- /dev/null +++ b/check_config.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +诊断配置文件加载情况 +""" +import os +import sys + +# 添加项目路径 +project_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, project_dir) + +print("=" * 80) +print("MaxKB 配置诊断工具") +print("=" * 80) + +# 检查环境变量 +print("\n1. 环境变量检查:") +print(f" MAXKB_CONFIG: {os.getenv('MAXKB_CONFIG', '未设置')}") +print(f" MAXKB_CONFIG_TYPE: {os.getenv('MAXKB_CONFIG_TYPE', '未设置')}") +print(f" SERVER_NAME: {os.getenv('SERVER_NAME', '未设置')}") + +# 检查配置文件路径 +print("\n2. 配置文件检查:") +config_paths = [ + os.path.join(project_dir, 'config.yaml'), + os.path.join(project_dir, 'config.yml'), + os.path.join(project_dir, 'config_example.yml'), + '/opt/maxkb/conf/config.yaml', + '/opt/maxkb/conf/config.yml' +] + +for path in config_paths: + exists = "✓ 存在" if os.path.isfile(path) else "✗ 不存在" + print(f" {path}: {exists}") + +# 加载配置并显示 +print("\n3. 实际加载的配置:") +try: + from apps.maxkb.const import CONFIG + + print(f" DB_HOST: {CONFIG.get('DB_HOST')}") + print(f" DB_PORT: {CONFIG.get('DB_PORT')}") + print(f" DB_NAME: {CONFIG.get('DB_NAME')}") + print(f" DB_USER: {CONFIG.get('DB_USER')}") + print(f" DB_PASSWORD: {CONFIG.get('DB_PASSWORD')}") + print(f" DB_ENGINE: {CONFIG.get('DB_ENGINE')}") + print(f" REDIS_HOST: {CONFIG.get('REDIS_HOST')}") + print(f" REDIS_PORT: {CONFIG.get('REDIS_PORT')}") + print(f" DEBUG: {CONFIG.get('DEBUG')}") + + # 显示完整的数据库配置 + print("\n4. Django 数据库配置:") + db_setting = CONFIG.get_db_setting() + for key, value in db_setting.items(): + if key != 'PASSWORD': # 不显示密码 + print(f" {key}: {value}") + else: + print(f" {key}: ***隐藏***") + +except Exception as e: + print(f" 错误:{e}") + import traceback + traceback.print_exc() + +print("\n" + "=" * 80) diff --git a/ui/src/layout/components/sidebar/index.vue b/ui/src/layout/components/sidebar/index.vue index e23c6c42a..616cdee7b 100644 --- a/ui/src/layout/components/sidebar/index.vue +++ b/ui/src/layout/components/sidebar/index.vue @@ -4,7 +4,7 @@

AI-RAG

- +
@@ -12,6 +12,9 @@ 应用 + + 思维导图 + 知识库 @@ -22,13 +25,13 @@ 模型
- +
用户管理 - +
@@ -50,7 +53,7 @@
- +
@@ -65,7 +68,7 @@
- +
@@ -90,6 +93,7 @@ const isSystemManagement = computed(() => { const activeMainMenu = computed(() => { const path = route.path if (path.startsWith('/application')) return '/application' + if (path.startsWith('/mindmap')) return '/mindmap' if (path.startsWith('/knowledge')) return '/knowledge' if (path.startsWith('/tool')) return '/tool' if (path.startsWith('/model')) return '/model' diff --git a/ui/src/router/modules/mindmap.ts b/ui/src/router/modules/mindmap.ts new file mode 100644 index 000000000..3f33ecde2 --- /dev/null +++ b/ui/src/router/modules/mindmap.ts @@ -0,0 +1,28 @@ +import { PermissionConst, RoleConst } from '@/utils/permission/data' +const mindmapRouter = { + path: '/mindmap', + name: 'mindmap', + meta: { + title: '思维导图', + menu: true, + permission: [ + RoleConst.USER.getWorkspaceRole, + RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, + ], + group: 'workspace', + order: 2, + }, + redirect: '/mindmap', + component: () => import('@/layout/layout-template/SimpleLayout.vue'), + children: [ + { + path: '/mindmap', + name: 'mindmap-index', + meta: { title: '思维导图', activeMenu: '/mindmap', sameRoute: 'mindmap' }, + component: () => import('@/views/mindmap/index.vue'), + hidden: true, + }, + ], +} + +export default mindmapRouter diff --git a/ui/src/views/mindmap/index.vue b/ui/src/views/mindmap/index.vue new file mode 100644 index 000000000..1fa519f32 --- /dev/null +++ b/ui/src/views/mindmap/index.vue @@ -0,0 +1,21 @@ + + + + +