feat(system): 添加系统配置管理功能

- 新增 system_config 视图模块用于系统配置获取
- 在 __init__.py 中导入新的系统配置视图
- 添加 MINDMAP_URL 配置项到 config.yaml 文件
- 更新 LayoutContainer 组件默认展开状态
- 实现思维导图动态 URL 配置加载
- 添加系统配置序列化器和 API 接口
- 在国际化文件中增加用户手册和论坛链接
- 升级 @logicflow/extension 和 jspdf 依赖包版本
- 初始化 package-lock.json 文件结构
v3.2
tanlianwang 2026-03-10 10:32:17 +08:00
parent c63485d53f
commit 37ac57941f
10 changed files with 53 additions and 11 deletions

View File

@ -42,3 +42,11 @@ class SystemProfileSerializer(serializers.Serializer):
return {'version': version, 'edition': settings.edition,
'license_is_valid': license_is_valid() if license_is_valid() is not None else False,
'ras': get_key_pair_by_sql().get('key')}
class SystemConfigSerializer(serializers.Serializer):
@staticmethod
def get_config():
return {
'mindmap_url': settings.config.get('MINDMAP_URL', '')
}

View File

@ -11,5 +11,6 @@ urlpatterns = [
path('workspace/<str:workspace_id>/resource_user_permission/resource/<str:target>/resource/<str:resource>/<int:current_page>/<int:page_size>', views.WorkspaceResourceUserPermissionView.Page.as_view()),
path('email_setting', views.SystemSetting.Email.as_view()),
path('profile', views.SystemProfile.as_view()),
path('valid/<str:valid_type>/<int:valid_count>', views.Valid.as_view())
path('valid/<str:valid_type>/<int:valid_count>', views.Valid.as_view()),
path('config', views.get_system_config)
]

View File

@ -10,3 +10,4 @@ from .user_resource_permission import *
from .email_setting import *
from .system_profile import *
from .valid import *
from .system_config import *

View File

@ -42,3 +42,6 @@ SESSION_TIMEOUT: 28800
# 沙盒Python包路径
SANDBOX_PYTHON_PACKAGE_PATHS: /opt/py3/lib/python3.11/site-packages,/opt/maxkb-app/sandbox/python-packages,/opt/maxkb/python-packages
# 思维导图服务配置
MINDMAP_URL: http://10.100.52.76:3000/

6
package-lock.json generated
View File

@ -2,5 +2,9 @@
"name": "MaxKB",
"lockfileVersion": 3,
"requires": true,
"packages": {}
"packages": {
"": {
"name": "MaxKB"
}
}
}

View File

@ -21,7 +21,7 @@
"@codemirror/lang-python": "^6.2.1",
"@codemirror/theme-one-dark": "^6.1.2",
"@logicflow/core": "^1.2.27",
"@logicflow/extension": "^1.2.27",
"@logicflow/extension": "^2.1.15",
"@vavt/cm-extension": "^1.9.1",
"@vueuse/core": "^13.3.0",
"axios": "^1.8.4",
@ -33,7 +33,7 @@
"highlight.js": "^11.11.1",
"html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"jspdf": "^3.0.3",
"jspdf": "^4.2.0",
"katex": "^0.16.10",
"marked": "^12.0.2",
"md-editor-v3": "^5.8.2",

View File

@ -50,7 +50,7 @@ const props = defineProps({
},
})
const isCollapse = ref(true)
const isCollapse = ref(false)
const leftWidth = ref(props.minLeftWidth)
const isResizing = ref(false)

View File

@ -2,5 +2,7 @@ export default {
logout: '退出登录',
apiKey: 'API Key 管理',
apiServiceAddress: 'API 服务地址',
language: '语言'
language: '语言',
userManualUrl: 'http://docs.maxkb.hk/',
forumUrl: 'https://github.com/1Panel-dev/MaxKB/discussions'
}

View File

@ -25,11 +25,12 @@
<ChinaMobileIcon />
<h1 style="font-size: 18px; font-weight: 600; margin: 0;">AI-RAG</h1>
</div>
<div style="display: flex; align-items: center;">
</div>
</div>
<LayoutContainer showCollapse resizable class="application-manage">
</div>
<LayoutContainer class="application-manage" :show-collapse="false">
<template #left>
<h4 class="p-12-16 pb-0 mt-12">{{ $t('chat.title') }}</h4>
<HistoryPanel
:application-detail="applicationDetail"
:chat-log-data="chatLogData"
@ -533,6 +534,13 @@ function closeExecutionDetail() {
}
</script>
<style lang="scss" scoped>
.app-top-bar-container {
height: var(--app-header-height);
box-sizing: border-box;
padding: var(--app-header-padding);
background: var(--app-header-bg-color);
}
.chat-pc {
height: 100%;
overflow: hidden;

View File

@ -5,7 +5,7 @@
</template>
<div class="mindmap-content">
<iframe
src="http://10.100.52.76:3000/"
:src="mindmapUrl"
style="width: 100%; height: 100%; border: none;"
title="思维导图"
></iframe>
@ -15,6 +15,21 @@
<script setup lang="ts">
import LayoutContainer from '@/components/layout-container/index.vue'
import { ref, onMounted } from 'vue'
import systemConfigApi from '@/api/system-settings/system-config'
const mindmapUrl = ref<string>('')
const loading = ref(false)
onMounted(() => {
systemConfigApi.getSystemConfig(loading).then((res: any) => {
if (res.data && res.data.mindmap_url) {
mindmapUrl.value = res.data.mindmap_url
}
}).catch((err) => {
console.error('Failed to load mindmap config:', err)
})
})
</script>
<style scoped>