Architecture: - load_dashboard.py: async data functions registered via load_dashboard() - init.py: calls load_dashboard() to expose on ServerEnv - Individual .ui files (Jinja2 templates): - today_usage.ui: calls get_today_usage(request) - today_amount.ui: calls get_today_amount(request) - total_users.ui: calls get_total_users(request) - concurrent_users.ui: calls get_concurrent_users(request) - top_models_chart.ui: calls get_top_models(request) for ChartBar - index.ui: each stat card wrapped in own RefreshWidget (10s period) - Removed deprecated .dspy files (dashboard_cards, get_today_usage, get_user_stats, get_top_models)
33 lines
810 B
XML
33 lines
810 B
XML
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"bgcolor": "#FFFFFF",
|
|
"padding": "24px",
|
|
"borderRadius": "8px",
|
|
"flex": "1",
|
|
"minHeight": "120px",
|
|
"boxShadow": "0 2px 8px rgba(0,0,0,0.1)"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "今日调用笔数",
|
|
"fontSize": "14px",
|
|
"color": "#888",
|
|
"marginBottom": "8px"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"id": "today_cnt_value",
|
|
"options": {
|
|
"text": "{{get_today_usage(request)}}",
|
|
"fontSize": "32px",
|
|
"fontWeight": "bold",
|
|
"color": "#1890ff"
|
|
}
|
|
}
|
|
]
|
|
}
|