feat: menu.ui + filler CSS + popup menu from top bar

This commit is contained in:
yumoqing 2026-07-22 13:06:50 +08:00
parent a0cc6a0f55
commit 16fa189959
3 changed files with 77 additions and 22 deletions

View File

@ -11,21 +11,23 @@
{
"widgettype": "urlwidget",
"options": {
"cheight": 2.5,
"url": "{{entire_url('/top.ui')}}"
}
},
{
"widgettype": "HBox",
"options": {
"css": "main-area",
"spacing": 0,
"width": "100%"
"css": "filler",
"width": "100%",
"spacing": 0
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"css": "rag-sidebar"
"css": "rag-sidebar",
"cwidth": 13
},
"subwidgets": [
{
@ -117,15 +119,14 @@
"widgettype": "VBox",
"options": {
"id": "rag_main_content",
"css": "rag-content",
"padding": "0"
"css": "filler",
"padding": "8px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "欢迎使用 RAG Server — 多媒体知识库平台",
"css": "",
"i18n": false
}
}
@ -136,7 +137,7 @@
{
"widgettype": "Text",
"options": {
"text": "© 2026 RAG Server · 开元云科技",
"text": "© 2026 RAG Server",
"css": "rag-bottom"
}
}

40
wwwroot/menu.ui Normal file
View File

@ -0,0 +1,40 @@
{% set roles = get_user_roles(get_user()) %}
{% set role_str = roles|join(',') %}
{
"widgettype": "Menu",
"id": "rag_menu",
"options": {
"width": "100%",
"height": "100%",
"items": [
{
"name": "knowledge_bases",
"label": "知识库",
"icon": "{{entire_url('/bricks/imgs/app.svg')}}",
"url": "{{entire_url('/knowledge_bases_list/index.ui')}}",
"target": "app.rag_main_content"
},
{
"name": "documents",
"label": "文档管理",
"icon": "{{entire_url('/bricks/imgs/app_add.svg')}}",
"url": "{{entire_url('/documents_list/index.ui')}}",
"target": "app.rag_main_content"
},
{
"name": "engines",
"label": "引擎配置",
"icon": "{{entire_url('/bricks/imgs/rocket.svg')}}",
"url": "{{entire_url('/engine_configs_list/index.ui')}}",
"target": "app.rag_main_content"
},
{
"name": "subscriptions",
"label": "订阅管理",
"icon": "{{entire_url('/bricks/imgs/coins.svg')}}",
"url": "{{entire_url('/subscriptions_list/index.ui')}}",
"target": "app.rag_main_content"
}
]
}
}

View File

@ -9,31 +9,45 @@
"align": "center",
"gap": "8px"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"css": "clickable",
"tip": "主菜单"
},
"subwidgets": [
{
"widgettype": "Svg",
"options": {
"rate": 2,
"url": "{{entire_url('/bricks/imgs/app.svg')}}",
"css": "clickable",
"tip": "RAG Server"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "bricks.app.show_windows_panel(event)"
"url": "{{entire_url('/bricks/imgs/app.svg')}}"
}
]
},
{
"widgettype": "Text",
"options": {
"text": "RAG Server",
"i18n": false,
"css": ""
"i18n": false
}
}
],
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "Popup",
"popup_options": {
"cwidth": 12,
"eventpos": true,
"dismiss_events": ["command"]
},
"options": {
"url": "{{entire_url('/menu.ui')}}"
}
}
]
},
{
"widgettype": "Text",