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

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