refactor: arrange model/user/provider charts in single row

This commit is contained in:
yumoqing 2026-06-01 15:56:14 +08:00
parent 80785e7ace
commit c89c0d89de
4 changed files with 63 additions and 67 deletions

View File

@ -1,7 +1,7 @@
{ {
"widgettype": "ChartBar", "widgettype": "ChartBar",
"options": { "options": {
"height": "280px", "height": "250px",
"width": "100%", "width": "100%",
"data_url": "{{entire_url('api/top_models.dspy')}}", "data_url": "{{entire_url('api/top_models.dspy')}}",
"nameField": "model_name", "nameField": "model_name",

View File

@ -1,7 +1,7 @@
{ {
"widgettype": "ChartBar", "widgettype": "ChartBar",
"options": { "options": {
"height": "300px", "height": "250px",
"data_url": "{{entire_url('api/top_providers.dspy')}}", "data_url": "{{entire_url('api/top_providers.dspy')}}",
"nameField": "provider_name", "nameField": "provider_name",
"valueFields": ["total_amount", "cnt"] "valueFields": ["total_amount", "cnt"]

View File

@ -1,7 +1,7 @@
{ {
"widgettype": "ChartBar", "widgettype": "ChartBar",
"options": { "options": {
"height": "300px", "height": "250px",
"data_url": "{{entire_url('api/top_users.dspy')}}", "data_url": "{{entire_url('api/top_users.dspy')}}",
"nameField": "user_name", "nameField": "user_name",
"valueFields": ["total_amount", "cnt"] "valueFields": ["total_amount", "cnt"]

View File

@ -150,7 +150,7 @@
"widgettype": "HBox", "widgettype": "HBox",
"options": { "options": {
"width": "100%", "width": "100%",
"gap": "20px", "gap": "16px",
"height": "auto" "height": "auto"
}, },
"subwidgets": [ "subwidgets": [
@ -158,9 +158,9 @@
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"css": "card", "css": "card",
"width": "100%", "width": "33%",
"borderRadius": "12px", "borderRadius": "12px",
"padding": "20px" "padding": "16px"
}, },
"subwidgets": [ "subwidgets": [
{ {
@ -168,7 +168,7 @@
"options": { "options": {
"width": "100%", "width": "100%",
"alignItems": "center", "alignItems": "center",
"marginBottom": "16px" "marginBottom": "12px"
}, },
"subwidgets": [ "subwidgets": [
{ {
@ -213,6 +213,62 @@
} }
} }
] ]
},
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "33%",
"borderRadius": "12px",
"padding": "16px"
},
"subwidgets": [
{
"widgettype": "Title4",
"options": {
"fontWeight": "600",
"marginBottom": "12px",
"otext": "用户排行",
"i18n": true
}
},
{
"widgettype": "RefreshWidget",
"id": "chart_top_users",
"options": {
"period_seconds": 60,
"url": "{{entire_url('chart_top_users.ui')}}"
}
}
]
},
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "33%",
"borderRadius": "12px",
"padding": "16px"
},
"subwidgets": [
{
"widgettype": "Title4",
"options": {
"fontWeight": "600",
"marginBottom": "12px",
"otext": "供应商排行",
"i18n": true
}
},
{
"widgettype": "RefreshWidget",
"id": "chart_top_providers",
"options": {
"period_seconds": 60,
"url": "{{entire_url('chart_top_providers.ui')}}"
}
}
]
} }
] ]
} }
@ -355,66 +411,6 @@
} }
] ]
} }
{% endif %}
{% if 'owner.*' in roles or 'reseller.*' in roles %}
,{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "100%",
"borderRadius": "12px",
"padding": "20px",
"marginTop": "20px"
},
"subwidgets": [
{
"widgettype": "Title4",
"options": {
"fontWeight": "600",
"marginBottom": "16px",
"otext": "用户排行",
"i18n": true
}
},
{
"widgettype": "RefreshWidget",
"id": "chart_top_users",
"options": {
"period_seconds": 60,
"url": "{{entire_url('chart_top_users.ui')}}"
}
}
]
},
{
"widgettype": "VBox",
"options": {
"css": "card",
"width": "100%",
"borderRadius": "12px",
"padding": "20px",
"marginTop": "20px"
},
"subwidgets": [
{
"widgettype": "Title4",
"options": {
"fontWeight": "600",
"marginBottom": "16px",
"otext": "供应商排行",
"i18n": true
}
},
{
"widgettype": "RefreshWidget",
"id": "chart_top_providers",
"options": {
"period_seconds": 60,
"url": "{{entire_url('chart_top_providers.ui')}}"
}
}
]
}
{% endif %} {% endif %}
] ]
} }