yumoqing ffdc7fc983 feat: modern UI redesign - shell layout, theme switching, dashboard revamp
Phase 1-2 deliverables:
- shell.ui: Global layout framework (topbar + collapsible sidebar + main content)
- shell_theme.css: Dark/light theme CSS custom properties system
- shell_theme.js: Theme toggle + sidebar collapse with localStorage persistence
- global_menu.ui: Unified module navigation menu with RBAC visibility
- index.ui: Redesigned dashboard homepage with modern stat cards + quick links
- Stat card widgets: today_usage, today_amount, total_users, concurrent, errors
- chart_top_models.ui + api/top_models.dspy: ChartBar with data_url pattern
- table_top_users_amount.ui: Jinja2-rendered user ranking table
- build.sh: Added .css file linking support

Design system:
- Dark theme (default): slate color palette (#0B1120, #111827, #1E293B)
- Light theme: clean white palette with matching structure
- Theme persisted in localStorage, toggled via topbar button
- Sidebar collapsible with icon-only mode, state persisted in localStorage
- Responsive stat cards with hover effects and trend indicators
- Quick link cards for model management, users, knowledge base, errors
2026-05-25 16:53:36 +08:00

148 lines
4.9 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"bgcolor": "#0B1120"
},
"subwidgets": [
{
"widgettype": "Html",
"options": {
"html": "<link rel=\"stylesheet\" href=\"/dashboard_for_sage/shell_theme.css\"><script src=\"/dashboard_for_sage/shell_theme.js\"><\\/script>"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "56px",
"bgcolor": "#111827",
"borderBottom": "1px solid #334155",
"padding": "0 16px",
"alignItems": "center"
},
"subwidgets": [
{
"widgettype": "Button",
"id": "sidebar_toggle_btn",
"options": {
"label": "",
"bgcolor": "transparent",
"color": "#94A3B8",
"border": "1px solid #334155",
"borderRadius": "8px",
"width": "36px",
"height": "36px",
"padding": "0"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "sageToggleSidebar()"
}
]
},
{
"widgettype": "Image",
"options": {
"url": "{{entire_url('/imgs/msp.png')}}",
"height": "32px",
"marginLeft": "12px"
}
},
{
"widgettype": "Title4",
"options": {
"text": "Sage",
"color": "#F1F5F9",
"fontWeight": "bold",
"marginLeft": "8px"
}
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"id": "theme_toggle_btn",
"options": {
"label": "",
"bgcolor": "transparent",
"color": "#94A3B8",
"border": "1px solid #334155",
"borderRadius": "50%",
"width": "36px",
"height": "36px",
"padding": "0"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "sageToggleTheme()"
}
]
},
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('/rbac/user/user_panel.ui')}}"
}
}
]
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "calc(100% - 56px)"
},
"subwidgets": [
{
"widgettype": "VBox",
"id": "sage_sidebar",
"options": {
"width": "240px",
"height": "100%",
"bgcolor": "#111827",
"borderRight": "1px solid #334155"
},
"subwidgets": [
{
"widgettype": "urlwidget",
"options": {
"url": "{{entire_url('global_menu.ui')}}"
}
}
]
},
{
"widgettype": "VBox",
"id": "sage_main_content",
"options": {
"css": "filler",
"height": "100%",
"padding": "24px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "加载中...",
"fontSize": "16px",
"color": "#94A3B8"
}
}
]
}
]
}
]
}