dashboard_for_sage/wwwroot/stat_active_users.ui
yumoqing 9cc59160e8 feat: add trend indicators and color accents to stat cards
- Add get_usage_trend() and get_amount_trend() functions for day-over-day comparison
- Display trend arrows (up/down/flat) with percentage change in stat_today_usage and stat_today_amount
- Add colored left borders to all stat cards for visual distinction:
  - Blue: usage, total users
  - Purple: amount, total orgs
  - Green: active users, new users this month
  - Cyan: concurrent users
  - Red: errors
- Enhance visual hierarchy with accent colors matching SVG icons
2026-06-01 15:49:46 +08:00

53 lines
1.6 KiB
XML

{
"widgettype": "VBox",
"options": {
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"flex": "1",
"minHeight": "110px",
"borderLeft": "4px solid #22c55e"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"alignItems": "center",
"marginBottom": "12px"
},
"subwidgets": [
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22C55E\" stroke-width=\"2\"><path d=\"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z\"/><path d=\"M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"/></svg>",
"width": "24px",
"height": "24px"
}
},
{
"widgettype": "Filler"
}
]
},
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_active_users_today(request)}}",
"fontSize": "32px",
"fontWeight": "700",
"lineHeight": "1.1"
}
},
{
"widgettype": "Text",
"options": {
"css": "stat-label",
"fontSize": "14px",
"marginTop": "4px",
"otext": "今日活跃用户",
"i18n": true
}
}
]
}