feat: Sage-style top/center/bottom layout with sidebar menu

This commit is contained in:
yumoqing 2026-07-22 12:12:16 +08:00
parent 39626a759c
commit 4791891fad
4 changed files with 200 additions and 81 deletions

18
wwwroot/i18n/language.ui Normal file
View File

@ -0,0 +1,18 @@
{
"widgettype": "Text",
"options": {
"css": "clickable",
"otext": "中",
"tip": "切换语言",
"i18n": false
},
"binds": [
{
"wid": "self",
"event": "app.lang",
"actiontype": "script",
"target": "self",
"script": "var L={'zh':'中','en':'EN','jp':'日','ko':'韩'};this.set_otext(L[bricks.app.lang]||'中')"
}
]
}

View File

@ -1,107 +1,132 @@
{
"id": "app",
"widgettype": "VBox",
"options": {
"css": "rag-home",
"align": "center",
"padding": "20px"
"css": "filler",
"width": "100%",
"height": "100%",
"spacing": 0
},
"subwidgets": [
{
"widgettype": "Text",
"widgettype": "urlwidget",
"options": {
"text": "RAG Server — 多媒体知识库平台",
"css": "rag-title",
"i18n": false
}
},
{
"widgettype": "Text",
"options": {
"text": "支持文本、图片、音频、视频文件的智能检索与知识管理",
"css": "rag-subtitle",
"i18n": false
"url": "{{entire_url('/top.ui')}}"
}
},
{
"widgettype": "HBox",
"options": {
"align": "center",
"gap": "16px",
"padding": "30px"
"css": "main-area",
"spacing": 0,
"width": "100%"
},
"subwidgets": [
{
"widgettype": "Button",
"widgettype": "VBox",
"options": {
"label": "知识库管理",
"bgcolor": "#4a90d9"
"css": "rag-sidebar"
},
"binds": [
"subwidgets": [
{
"wid": "self",
"event": "tap",
"actiontype": "urlwidget",
"target": "app.rag_main",
"mode": "replace",
"widgettype": "Text",
"options": {
"url": "{{entire_url('/knowledge_bases_list/index.ui')}}"
"text": "RAG Server",
"css": "menu-title"
}
},
{
"widgettype": "Text",
"options": {
"text": "知识库",
"css": "menu-item"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "app.rag_main_content",
"mode": "replace",
"options": {
"url": "{{entire_url('/knowledge_bases_list/index.ui')}}"
}
}
]
},
{
"widgettype": "Text",
"options": {
"text": "文档管理",
"css": "menu-item"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "app.rag_main_content",
"mode": "replace",
"options": {
"url": "{{entire_url('/documents_list/index.ui')}}"
}
}
]
},
{
"widgettype": "Text",
"options": {
"text": "引擎配置",
"css": "menu-item"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "app.rag_main_content",
"mode": "replace",
"options": {
"url": "{{entire_url('/engine_configs_list/index.ui')}}"
}
}
]
},
{
"widgettype": "Text",
"options": {
"text": "订阅管理",
"css": "menu-item"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "app.rag_main_content",
"mode": "replace",
"options": {
"url": "{{entire_url('/subscriptions_list/index.ui')}}"
}
}
]
}
]
},
{
"widgettype": "Button",
"widgettype": "VBox",
"options": {
"label": "文档管理",
"bgcolor": "#50b86c"
"id": "rag_main_content",
"css": "rag-content",
"padding": "0"
},
"binds": [
"subwidgets": [
{
"wid": "self",
"event": "tap",
"actiontype": "urlwidget",
"target": "app.rag_main",
"mode": "replace",
"widgettype": "Text",
"options": {
"url": "{{entire_url('/documents_list/index.ui')}}"
}
}
]
},
{
"widgettype": "Button",
"options": {
"label": "引擎配置",
"bgcolor": "#e6a23c"
},
"binds": [
{
"wid": "self",
"event": "tap",
"actiontype": "urlwidget",
"target": "app.rag_main",
"mode": "replace",
"options": {
"url": "{{entire_url('/engine_configs_list/index.ui')}}"
}
}
]
},
{
"widgettype": "Button",
"options": {
"label": "订阅管理",
"bgcolor": "#f56c6c"
},
"binds": [
{
"wid": "self",
"event": "tap",
"actiontype": "urlwidget",
"target": "app.rag_main",
"mode": "replace",
"options": {
"url": "{{entire_url('/subscriptions_list/index.ui')}}"
"text": "欢迎使用 RAG Server — 多媒体知识库平台",
"css": "",
"i18n": false
}
}
]
@ -109,12 +134,11 @@
]
},
{
"widgettype": "VBox",
"widgettype": "Text",
"options": {
"id": "rag_main",
"padding": "20px"
},
"subwidgets": []
"text": "© 2026 RAG Server · 开元云科技",
"css": "rag-bottom"
}
}
]
}

19
wwwroot/shell_theme.css Normal file
View File

@ -0,0 +1,19 @@
/* RAG Server Shell Theme */
html, body { margin:0; padding:0; height:100%; overflow:hidden; }
#app { display:flex; flex-direction:column; height:100vh; }
/* Top bar */
#top_panel { flex-shrink:0; }
/* Center: menu + content */
.main-area { flex:1; display:flex; overflow:hidden; }
.rag-sidebar { width:200px; flex-shrink:0; background:#2c2c2c; color:#ccc; overflow-y:auto; }
.rag-sidebar .menu-title { padding:12px 16px; font-size:13px; color:#888; text-transform:uppercase; border-bottom:1px solid #3a3a3a; }
.rag-sidebar .menu-item { padding:10px 20px; cursor:pointer; font-size:14px; transition:background .2s; }
.rag-sidebar .menu-item:hover { background:#3a3a3a; color:#fff; }
/* Content */
.rag-content { flex:1; overflow:auto; padding:0; }
/* Bottom */
.rag-bottom { flex-shrink:0; padding:8px 16px; text-align:center; font-size:12px; color:#888; background:#1a1a1a; border-top:1px solid #333; }

58
wwwroot/top.ui Normal file
View File

@ -0,0 +1,58 @@
{
"id": "top_panel",
"widgettype": "HBox",
"options": {
"bgcolor": "#2c2c2c",
"cheight": 2.5,
"color": "#eeeeee",
"padding": "0 8px",
"align": "center",
"gap": "8px"
},
"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)"
}
]
},
{
"widgettype": "Text",
"options": {
"text": "RAG Server",
"i18n": false,
"css": ""
}
},
{
"widgettype": "Text",
"options": {
"text": "",
"css": "filler"
}
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('/i18n/language.ui')}}"
}
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('/rbac/user/user_panel.ui')}}"
}
}
]
}