fix dashboard UI: quick-link css class, stat-card theming, remove hardcoded colors, light theme overrides

This commit is contained in:
yumoqing 2026-05-28 18:10:59 +08:00
parent 3659533102
commit e2687054df
15 changed files with 290 additions and 212 deletions

View File

@ -128,6 +128,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "60%",
"borderRadius": "12px",
"padding": "20px"
@ -187,6 +188,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "40%",
"borderRadius": "12px",
"padding": "20px"
@ -211,6 +213,7 @@
{
"widgettype": "Button",
"options": {
"css": "quick-link",
"padding": "16px",
"borderRadius": "8px",
"textAlign": "center"
@ -237,7 +240,7 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#90caf9\" stroke-width=\"2\"><path d=\"M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15.75c-2.062 0-4.024-.614-5.67-1.757l-1.57-.393m15.04 0L12 21 5.25 13.893\"/></svg>"
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15.75c-2.062 0-4.024-.614-5.67-1.757l-1.57-.393m15.04 0L12 21 5.25 13.893\"/></svg>"
}
},
{
@ -257,6 +260,7 @@
{
"widgettype": "Button",
"options": {
"css": "quick-link",
"padding": "16px",
"borderRadius": "8px",
"textAlign": "center"
@ -283,7 +287,7 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#4caf50\" stroke-width=\"2\"><path d=\"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z\"/></svg>"
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z\"/></svg>"
}
},
{
@ -303,6 +307,7 @@
{
"widgettype": "Button",
"options": {
"css": "quick-link",
"padding": "16px",
"borderRadius": "8px",
"border": "none",
@ -330,12 +335,13 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"2\"><path d=\"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125\"/></svg>"
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125\"/></svg>"
}
},
{
"widgettype": "Text",
"options": {
"fontWeight": "600",
"fontSize": "13px",
"marginTop": "8px",
"otext": "知识库",
@ -349,6 +355,7 @@
{
"widgettype": "Button",
"options": {
"css": "quick-link",
"padding": "16px",
"borderRadius": "8px",
"border": "none",
@ -376,12 +383,13 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#ef4444\" stroke-width=\"2\"><path d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"/></svg>"
"svg": "<svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"/></svg>"
}
},
{
"widgettype": "Text",
"options": {
"fontWeight": "600",
"fontSize": "13px",
"marginTop": "8px",
"otext": "异常记录",
@ -401,6 +409,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "100%",
"borderRadius": "12px",
"padding": "20px",
@ -429,6 +438,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "100%",
"borderRadius": "12px",
"padding": "20px",
@ -465,6 +475,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "50%",
"borderRadius": "12px",
"padding": "20px"
@ -492,6 +503,7 @@
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "50%",
"borderRadius": "12px",
"padding": "20px"

View File

@ -726,6 +726,20 @@ body {
color: var(--sage-text-primary);
}
[data-theme="light"] .tabular { background-color: #f5f5f5; color: #1E293B; }
[data-theme="light"] .tabular-header-row { background-color: #E2E8F0; color: #0F172A; font-weight: 600; }
[data-theme="light"] .tabular-header-row .tabular-cell { color: #0F172A; }
[data-theme="light"] .tabular-row { color: #1E293B; }
[data-theme="light"] .tabular-row:nth-child(odd) { background-color: #FFFFFF; }
[data-theme="light"] .tabular-row:nth-child(even) { background-color: #F8FAFC; }
[data-theme="light"] .tabular-cell { border-color: #E2E8F0; color: #1E293B; }
[data-theme="light"] .card { color: #1E293B; }
[data-theme="light"] .inputbox { color: #1E293B; background-color: #FFFFFF; }
[data-theme="light"] .popup, [data-theme="light"] .modal { color: #1E293B; }
[data-theme="light"] .accordion-item-info { color: #475569; }
[data-theme="light"] .toolbar-button { color: #334155; }
[data-theme="light"] .message { color: #1E293B; }
/* ===== Menu Overrides ===== */
[data-theme="dark"] .menu-item {
color: var(--sage-text-secondary);

View File

@ -1,6 +1,7 @@
{
"widgettype": "VBox",
"options": {
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"flex": "1",
@ -30,6 +31,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_active_users_today(request)}}",
"fontSize": "32px",
"fontWeight": "700",
@ -39,6 +41,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-label",
"fontSize": "14px",
"marginTop": "4px",
"otext": "今日活跃用户",

View File

@ -1,10 +1,8 @@
{
"widgettype": "VBox",
"options": {
"bgcolor": "#1E293B",
"padding": "20px",
"borderRadius": "12px",
"border": "1px solid #334155",
"flex": "1",
"minHeight": "110px"
},
@ -32,10 +30,10 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_concurrent_users(request)}}",
"fontSize": "32px",
"fontWeight": "700",
"color": "#F1F5F9",
"lineHeight": "1.1"
}
},
@ -43,7 +41,6 @@
"widgettype": "Text",
"options": {
"fontSize": "14px",
"color": "#94A3B8",
"marginTop": "4px",
"otext": "在线用户",
"i18n": true

View File

@ -1,6 +1,7 @@
{
"widgettype": "VBox",
"options": {
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"flex": "1",
@ -30,6 +31,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_accounting_errors(request)}}",
"fontSize": "32px",
"fontWeight": "700",

View File

@ -1,10 +1,8 @@
{
"widgettype": "VBox",
"options": {
"bgcolor": "#1E293B",
"padding": "20px",
"borderRadius": "12px",
"border": "1px solid #334155",
"flex": "1",
"minHeight": "110px"
},
@ -32,10 +30,10 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_new_users_month(request)}}",
"fontSize": "32px",
"fontWeight": "700",
"color": "#F1F5F9",
"lineHeight": "1.1"
}
},
@ -43,7 +41,6 @@
"widgettype": "Text",
"options": {
"fontSize": "14px",
"color": "#94A3B8",
"marginTop": "4px",
"otext": "本月新增用户",
"i18n": true

View File

@ -1,10 +1,9 @@
{
"widgettype": "VBox",
"options": {
"bgcolor": "#1E293B",
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"border": "1px solid #334155",
"flex": "1",
"minHeight": "110px"
},
@ -19,7 +18,7 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22C55E\" stroke-width=\"2\"><path d=\"M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"/></svg>",
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 6v12m6-6H6\"/></svg>",
"width": "24px",
"height": "24px"
}
@ -32,20 +31,20 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "¥{{get_today_amount(request)|round(2)}}",
"fontSize": "32px",
"fontWeight": "700",
"color": "#F1F5F9",
"lineHeight": "1.1"
}
},
{
"widgettype": "Text",
"options": {
"css": "stat-label",
"fontSize": "14px",
"color": "#94A3B8",
"marginTop": "4px",
"otext": "今日消费金额",
"otext": "今日交易金额",
"i18n": true
}
}

View File

@ -1,6 +1,7 @@
{
"widgettype": "VBox",
"options": {
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"flex": "1",
@ -18,7 +19,7 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#3B82F6\" stroke-width=\"2\"><path d=\"M7.5 21L3 16.5m0 0L7.5 12M12 9v7.5m0 0l4.5-4.5M12 9l4.5 4.5m0 0L12 16.5\"/><path d=\"M21 12h-4.5M12 3v4.5m0 0L7.5 12\"/></svg>",
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M7.5 21L3 16.5m0 0L7.5 12M12 9v7.5m0 0l4.5-4.5M12 9l4.5 4.5m0 0L12 16.5\"/><path d=\"M21 12h-4.5M12 3v4.5m0 0L7.5 12\"/></svg>",
"width": "24px",
"height": "24px"
}
@ -31,6 +32,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_today_usage(request)}}",
"fontSize": "32px",
"fontWeight": "700",
@ -40,6 +42,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-label",
"fontSize": "14px",
"marginTop": "4px",
"otext": "今日调用笔数",

View File

@ -1,10 +1,8 @@
{
"widgettype": "VBox",
"options": {
"bgcolor": "#1E293B",
"padding": "20px",
"borderRadius": "12px",
"border": "1px solid #334155",
"flex": "1",
"minHeight": "110px"
},
@ -32,10 +30,10 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_total_orgs(request)}}",
"fontSize": "32px",
"fontWeight": "700",
"color": "#F1F5F9",
"lineHeight": "1.1"
}
},
@ -43,7 +41,6 @@
"widgettype": "Text",
"options": {
"fontSize": "14px",
"color": "#94A3B8",
"marginTop": "4px",
"otext": "组织机构数",
"i18n": true

View File

@ -1,6 +1,7 @@
{
"widgettype": "VBox",
"options": {
"css": "stat-card",
"padding": "20px",
"borderRadius": "12px",
"flex": "1",
@ -17,7 +18,7 @@
{
"widgettype": "Svg",
"options": {
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#A78BFA\" stroke-width=\"2\"><path d=\"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z\"/></svg>",
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z\"/></svg>",
"width": "24px",
"height": "24px"
}
@ -30,6 +31,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-value",
"text": "{{get_total_users(request)}}",
"fontSize": "32px",
"fontWeight": "700",
@ -39,6 +41,7 @@
{
"widgettype": "Text",
"options": {
"css": "stat-label",
"fontSize": "14px",
"marginTop": "4px",
"otext": "用户总数",

View File

@ -48,7 +48,6 @@
"options": {
"text": "¥{{p.total_amount}}",
"width": "100px",
"color": "#22C55E",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "right"

View File

@ -49,7 +49,6 @@
"options": {
"text": "¥{{p.total_amount}}",
"width": "100px",
"color": "#22C55E",
"fontSize": "13px",
"textAlign": "right"
}

View File

@ -1,16 +1,74 @@
{% set users = get_top_users_by_amount(request) %}
{
"widgettype": "VBox",
"options": {
"width": "100%"
},
"subwidgets": [
{% for u in users %}
{
"widgettype": "RefreshWidget",
"id": "table_top_users_amount",
"widgettype": "HBox",
"options": {
"period_seconds": 30,
"url": "{{entire_url('table_top_users_amount.ui')}}"
"width": "100%",
"padding": "12px 0",
{% if not loop.first %}
"borderTop": "1px solid var(--sage-border-weak)",
{% endif %}
"alignItems": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "{{loop.index}}",
"width": "30px",
"fontSize": "14px",
"textAlign": "center"
}
},
{
"widgettype": "Text",
"options": {
"text": "{{u.user_name}}",
"flex": "1",
"fontSize": "14px",
"fontWeight": "500"
}
},
{
"widgettype": "Text",
"options": {
"text": "{{u.cnt}} 笔",
"width": "80px",
"fontSize": "13px",
"textAlign": "right"
}
},
{
"widgettype": "Text",
"options": {
"text": "¥{{u.total_amount}}",
"width": "100px",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "right"
}
}
]
}{% if not loop.last %},{% endif %}
{% endfor %}
{% if not users %}
{
"widgettype": "Text",
"options": {
"otext": "暂无数据",
"i18n": true,
"fontSize": "14px",
"textAlign": "center",
"padding": "20px 0"
}
}
{% endif %}
]
}

View File

@ -12,7 +12,7 @@
"width": "100%",
"padding": "12px 0",
{% if not loop.first %}
"borderTop": "1px solid #334155",
"borderTop": "1px solid var(--sage-border-weak)",
{% endif %}
"alignItems": "center"
},
@ -22,7 +22,6 @@
"options": {
"text": "{{loop.index}}",
"width": "30px",
"color": "#64748B",
"fontSize": "14px",
"textAlign": "center"
}
@ -32,7 +31,6 @@
"options": {
"text": "{{u.user_name}}",
"flex": "1",
"color": "#F1F5F9",
"fontSize": "14px",
"fontWeight": "500"
}
@ -42,7 +40,6 @@
"options": {
"text": "{{u.cnt}} 笔",
"width": "80px",
"color": "#94A3B8",
"fontSize": "13px",
"textAlign": "right"
}
@ -52,7 +49,6 @@
"options": {
"text": "¥{{u.total_amount}}",
"width": "100px",
"color": "#22C55E",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "right"

View File

@ -49,7 +49,6 @@
"options": {
"text": "¥{{u.total_amount}}",
"width": "100px",
"color": "#22C55E",
"fontSize": "13px",
"textAlign": "right"
}