From 398e90fa17ccf31f997ebae698062dc273921544 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 2 Jun 2026 00:25:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20dashboard=E5=B8=83=E5=B1=80=E9=87=8D?= =?UTF-8?q?=E6=9E=84=20-=20=E4=BF=AE=E5=A4=8D=E9=81=AE=E6=8C=A1/=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E6=A8=A1=E5=9E=8B=E9=87=91=E9=A2=9D/=E4=BB=8A?= =?UTF-8?q?=E6=97=A5=E6=8C=87=E6=A0=87=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 热门模型: valueFields改为[total_amount, cnt],与用户/供应商一致 2. 布局重构: - 第一行: 今日调用总量+今日交易金额(2个50%宽卡片) - 第二行: 用户总数+活跃用户+在线用户+记账异常(4个25%宽卡片) - 第三行: 热门模型+用户排行+供应商排行(3个33%宽图表) 3. 图表高度统一250px,间距16px 4. 移除ResponsableBox改用HBox,避免卡片溢出遮挡 5. 移除stat_new_users_month和stat_total_orgs,精简指标 --- wwwroot/chart_top_models.ui | 4 +-- wwwroot/chart_top_providers.ui | 2 +- wwwroot/chart_top_users.ui | 2 +- wwwroot/index.ui | 64 ++++++++++++++-------------------- 4 files changed, 30 insertions(+), 42 deletions(-) diff --git a/wwwroot/chart_top_models.ui b/wwwroot/chart_top_models.ui index fd0232d..cc1c7eb 100644 --- a/wwwroot/chart_top_models.ui +++ b/wwwroot/chart_top_models.ui @@ -1,10 +1,10 @@ { "widgettype": "ChartBar", "options": { - "height": "210px", + "height": "250px", "width": "100%", "data_url": "{{entire_url('api/top_models.dspy')}}", "nameField": "model_name", - "valueFields": ["cnt", "total_amount"] + "valueFields": ["total_amount", "cnt"] } } diff --git a/wwwroot/chart_top_providers.ui b/wwwroot/chart_top_providers.ui index 250e138..f582758 100644 --- a/wwwroot/chart_top_providers.ui +++ b/wwwroot/chart_top_providers.ui @@ -1,7 +1,7 @@ { "widgettype": "ChartBar", "options": { - "height": "210px", + "height": "250px", "data_url": "{{entire_url('api/top_providers.dspy')}}", "nameField": "provider_name", "valueFields": ["total_amount", "cnt"] diff --git a/wwwroot/chart_top_users.ui b/wwwroot/chart_top_users.ui index de60ae0..ae0482e 100644 --- a/wwwroot/chart_top_users.ui +++ b/wwwroot/chart_top_users.ui @@ -1,7 +1,7 @@ { "widgettype": "ChartBar", "options": { - "height": "210px", + "height": "250px", "data_url": "{{entire_url('api/top_users.dspy')}}", "nameField": "user_name", "valueFields": ["total_amount", "cnt"] diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 45fe20c..0bcf372 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -36,7 +36,7 @@ { "widgettype": "Text", "options": { - "text": "最后更新: {{get_today_usage(request) and request._run_ns.curDateString() or ''}}", + "text": "{{get_today_usage(request) and request._run_ns.curDateString() or ''}}", "fontSize": "13px" } }, @@ -65,11 +65,10 @@ } {% if 'owner.*' in roles or 'reseller.*' in roles %} ,{ - "widgettype": "ResponsableBox", + "widgettype": "HBox", "options": { "width": "100%", "gap": "16px", - "minWidth": "180px", "marginBottom": "16px" }, "subwidgets": [ @@ -78,7 +77,8 @@ "id": "stat_today_usage", "options": { "period_seconds": 30, - "url": "{{entire_url('stat_today_usage.ui')}}" + "url": "{{entire_url('stat_today_usage.ui')}}", + "width": "50%" } }, { @@ -86,15 +86,27 @@ "id": "stat_today_amount", "options": { "period_seconds": 30, - "url": "{{entire_url('stat_today_amount.ui')}}" + "url": "{{entire_url('stat_today_amount.ui')}}", + "width": "50%" } - }, + } + ] + }, + { + "widgettype": "HBox", + "options": { + "width": "100%", + "gap": "16px", + "marginBottom": "16px" + }, + "subwidgets": [ { "widgettype": "RefreshWidget", "id": "stat_total_users", "options": { "period_seconds": 60, - "url": "{{entire_url('stat_total_users.ui')}}" + "url": "{{entire_url('stat_total_users.ui')}}", + "width": "25%" } }, { @@ -102,7 +114,8 @@ "id": "stat_active_users", "options": { "period_seconds": 60, - "url": "{{entire_url('stat_active_users.ui')}}" + "url": "{{entire_url('stat_active_users.ui')}}", + "width": "25%" } }, { @@ -110,7 +123,8 @@ "id": "stat_concurrent", "options": { "period_seconds": 15, - "url": "{{entire_url('stat_concurrent.ui')}}" + "url": "{{entire_url('stat_concurrent.ui')}}", + "width": "25%" } }, { @@ -118,34 +132,8 @@ "id": "stat_errors", "options": { "period_seconds": 30, - "url": "{{entire_url('stat_errors.ui')}}" - } - } - ] - }, - { - "widgettype": "ResponsableBox", - "options": { - "width": "100%", - "gap": "16px", - "minWidth": "180px", - "marginBottom": "16px" - }, - "subwidgets": [ - { - "widgettype": "RefreshWidget", - "id": "stat_new_users_month", - "options": { - "period_seconds": 120, - "url": "{{entire_url('stat_new_users_month.ui')}}" - } - }, - { - "widgettype": "RefreshWidget", - "id": "stat_total_orgs", - "options": { - "period_seconds": 120, - "url": "{{entire_url('stat_total_orgs.ui')}}" + "url": "{{entire_url('stat_errors.ui')}}", + "width": "25%" } } ] @@ -419,4 +407,4 @@ ] } ] -} \ No newline at end of file +}