feat(layout): 加上思维导图侧边栏

v3.2
tanlianwang 2026-03-04 14:33:55 +08:00
parent fca23b4816
commit 03bb2d8906
4 changed files with 124 additions and 5 deletions

66
check_config.py 100644
View File

@ -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)

View File

@ -4,7 +4,7 @@
<div style="padding: 16px;">
<h1 style="font-size: 18px; font-weight: 600; margin: 0;">AI-RAG</h1>
</div>
<!-- 业务菜单或系统管理菜单 -->
<div style="padding: 0 16px;">
<!-- 业务菜单 -->
@ -12,6 +12,9 @@
<router-link to="/application" style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;" :style="activeMainMenu === '/application' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}">
应用
</router-link>
<router-link to="/mindmap" style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;" :style="activeMainMenu === '/mindmap' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}">
思维导图
</router-link>
<router-link to="/knowledge" style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;" :style="activeMainMenu === '/knowledge' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}">
知识库
</router-link>
@ -22,13 +25,13 @@
模型
</router-link>
</div>
<!-- 系统管理菜单 -->
<div v-else style="display: flex; flex-direction: column; gap: 8px;">
<router-link to="/system/user" style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;" :style="activeSystemMenu === '/system/user' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}">
用户管理
</router-link>
<!-- 资源授权下拉展开 -->
<div>
<div style="display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-radius: 8px; cursor: pointer;" :style="activeSystemMenu.startsWith('/system/authorization') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}" @click="toggleResourceAuth">
@ -50,7 +53,7 @@
</router-link>
</div>
</div>
<!-- 系统设置下拉展开 -->
<div>
<div style="display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-radius: 8px; cursor: pointer;" :style="activeSystemMenu.startsWith('/system/email') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}" @click="toggleSystemSettings">
@ -65,7 +68,7 @@
</div>
</div>
</div>
<!-- 底部用户信息区 -->
<div style="margin-top: auto; padding: 16px; border-top: 1px solid #e5e7eb;">
<UserAvatar />
@ -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'

View File

@ -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

View File

@ -0,0 +1,21 @@
<template>
<div class="mindmap-container">
<iframe
src="http://10.100.52.76:3000/"
style="width: 100%; height: 100vh; border: none;"
title="思维导图"
></iframe>
</div>
</template>
<script setup lang="ts">
//
</script>
<style scoped>
.mindmap-container {
width: 100%;
height: 100vh;
overflow: hidden;
}
</style>