dashboard_for_sage/wwwroot/table_top_users_amount.ui
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

78 lines
2.3 KiB
XML

{% set users = get_top_users_by_amount(request) %}
{
"widgettype": "VBox",
"options": {
"width": "100%"
},
"subwidgets": [
{% for u in users %}
{
"widgettype": "HBox",
"options": {
"width": "100%",
"padding": "12px 0",
{% if not loop.first %}
"borderTop": "1px solid #334155",
{% endif %}
"alignItems": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "{{loop.index}}",
"width": "30px",
"color": "#64748B",
"fontSize": "14px",
"textAlign": "center"
}
},
{
"widgettype": "Text",
"options": {
"text": "{{u.user_name}}",
"flex": "1",
"color": "#F1F5F9",
"fontSize": "14px",
"fontWeight": "500"
}
},
{
"widgettype": "Text",
"options": {
"text": "{{u.cnt}} 笔",
"width": "80px",
"color": "#94A3B8",
"fontSize": "13px",
"textAlign": "right"
}
},
{
"widgettype": "Text",
"options": {
"text": "¥{{u.total_amount}}",
"width": "100px",
"color": "#22C55E",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "right"
}
}
]
}{% if not loop.last %},{% endif %}
{% endfor %}
{% if not users %}
{
"widgettype": "Text",
"options": {
"text": "暂无数据",
"color": "#64748B",
"fontSize": "14px",
"textAlign": "center",
"padding": "20px 0"
}
}
{% endif %}
]
}