feat(system): 添加系统配置管理功能
- 新增 system_config 视图模块用于系统配置获取 - 在 __init__.py 中导入新的系统配置视图 - 添加 MINDMAP_URL 配置项到 config.yaml 文件 - 更新 LayoutContainer 组件默认展开状态 - 实现思维导图动态 URL 配置加载 - 添加系统配置序列化器和 API 接口 - 在国际化文件中增加用户手册和论坛链接 - 升级 @logicflow/extension 和 jspdf 依赖包版本 - 初始化 package-lock.json 文件结构v3.2
parent
c63485d53f
commit
37ac57941f
|
|
@ -42,3 +42,11 @@ class SystemProfileSerializer(serializers.Serializer):
|
||||||
return {'version': version, 'edition': settings.edition,
|
return {'version': version, 'edition': settings.edition,
|
||||||
'license_is_valid': license_is_valid() if license_is_valid() is not None else False,
|
'license_is_valid': license_is_valid() if license_is_valid() is not None else False,
|
||||||
'ras': get_key_pair_by_sql().get('key')}
|
'ras': get_key_pair_by_sql().get('key')}
|
||||||
|
|
||||||
|
|
||||||
|
class SystemConfigSerializer(serializers.Serializer):
|
||||||
|
@staticmethod
|
||||||
|
def get_config():
|
||||||
|
return {
|
||||||
|
'mindmap_url': settings.config.get('MINDMAP_URL', '')
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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('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('email_setting', views.SystemSetting.Email.as_view()),
|
||||||
path('profile', views.SystemProfile.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)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,4 @@ from .user_resource_permission import *
|
||||||
from .email_setting import *
|
from .email_setting import *
|
||||||
from .system_profile import *
|
from .system_profile import *
|
||||||
from .valid import *
|
from .valid import *
|
||||||
|
from .system_config import *
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,7 @@ CHAT_PATH: /chat
|
||||||
SESSION_TIMEOUT: 28800
|
SESSION_TIMEOUT: 28800
|
||||||
|
|
||||||
# 沙盒Python包路径
|
# 沙盒Python包路径
|
||||||
SANDBOX_PYTHON_PACKAGE_PATHS: /opt/py3/lib/python3.11/site-packages,/opt/maxkb-app/sandbox/python-packages,/opt/maxkb/python-packages
|
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/
|
||||||
|
|
@ -2,5 +2,9 @@
|
||||||
"name": "MaxKB",
|
"name": "MaxKB",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {}
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "MaxKB"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
"@codemirror/lang-python": "^6.2.1",
|
"@codemirror/lang-python": "^6.2.1",
|
||||||
"@codemirror/theme-one-dark": "^6.1.2",
|
"@codemirror/theme-one-dark": "^6.1.2",
|
||||||
"@logicflow/core": "^1.2.27",
|
"@logicflow/core": "^1.2.27",
|
||||||
"@logicflow/extension": "^1.2.27",
|
"@logicflow/extension": "^2.1.15",
|
||||||
"@vavt/cm-extension": "^1.9.1",
|
"@vavt/cm-extension": "^1.9.1",
|
||||||
"@vueuse/core": "^13.3.0",
|
"@vueuse/core": "^13.3.0",
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"html-to-image": "^1.11.13",
|
"html-to-image": "^1.11.13",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"jspdf": "^3.0.3",
|
"jspdf": "^4.2.0",
|
||||||
"katex": "^0.16.10",
|
"katex": "^0.16.10",
|
||||||
"marked": "^12.0.2",
|
"marked": "^12.0.2",
|
||||||
"md-editor-v3": "^5.8.2",
|
"md-editor-v3": "^5.8.2",
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const isCollapse = ref(true)
|
const isCollapse = ref(false)
|
||||||
const leftWidth = ref(props.minLeftWidth)
|
const leftWidth = ref(props.minLeftWidth)
|
||||||
const isResizing = ref(false)
|
const isResizing = ref(false)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,7 @@ export default {
|
||||||
logout: '退出登录',
|
logout: '退出登录',
|
||||||
apiKey: 'API Key 管理',
|
apiKey: 'API Key 管理',
|
||||||
apiServiceAddress: 'API 服务地址',
|
apiServiceAddress: 'API 服务地址',
|
||||||
language: '语言'
|
language: '语言',
|
||||||
|
userManualUrl: 'http://docs.maxkb.hk/',
|
||||||
|
forumUrl: 'https://github.com/1Panel-dev/MaxKB/discussions'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,12 @@
|
||||||
<ChinaMobileIcon />
|
<ChinaMobileIcon />
|
||||||
<h1 style="font-size: 18px; font-weight: 600; margin: 0;">AI-RAG</h1>
|
<h1 style="font-size: 18px; font-weight: 600; margin: 0;">AI-RAG</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<LayoutContainer showCollapse resizable class="application-manage">
|
<LayoutContainer class="application-manage" :show-collapse="false">
|
||||||
<template #left>
|
<template #left>
|
||||||
<h4 class="p-12-16 pb-0 mt-12">{{ $t('chat.title') }}</h4>
|
|
||||||
<HistoryPanel
|
<HistoryPanel
|
||||||
:application-detail="applicationDetail"
|
:application-detail="applicationDetail"
|
||||||
:chat-log-data="chatLogData"
|
:chat-log-data="chatLogData"
|
||||||
|
|
@ -533,6 +534,13 @@ function closeExecutionDetail() {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<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 {
|
.chat-pc {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
<h4 class="p-12-16 pb-0 mt-12">思维导图</h4>
|
<h4 class="p-12-16 pb-0 mt-12">思维导图</h4>
|
||||||
</template>
|
</template>
|
||||||
<div class="mindmap-content">
|
<div class="mindmap-content">
|
||||||
<iframe
|
<iframe
|
||||||
src="http://10.100.52.76:3000/"
|
:src="mindmapUrl"
|
||||||
style="width: 100%; height: 100%; border: none;"
|
style="width: 100%; height: 100%; border: none;"
|
||||||
title="思维导图"
|
title="思维导图"
|
||||||
></iframe>
|
></iframe>
|
||||||
|
|
@ -15,6 +15,21 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import LayoutContainer from '@/components/layout-container/index.vue'
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue