diff --git a/wwwroot/i18n/language.ui b/wwwroot/i18n/language.ui new file mode 100644 index 0000000..065607e --- /dev/null +++ b/wwwroot/i18n/language.ui @@ -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]||'中')" + } + ] +} diff --git a/wwwroot/index.ui b/wwwroot/index.ui index d4da3f9..32e436b 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -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" + } } ] } diff --git a/wwwroot/shell_theme.css b/wwwroot/shell_theme.css new file mode 100644 index 0000000..601510e --- /dev/null +++ b/wwwroot/shell_theme.css @@ -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; } diff --git a/wwwroot/top.ui b/wwwroot/top.ui new file mode 100644 index 0000000..57a98c8 --- /dev/null +++ b/wwwroot/top.ui @@ -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')}}" + } + } + ] +}