171 lines
11 KiB
XML
171 lines
11 KiB
XML
{% set roles = get_user_roles(get_user()) %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"id": "datamart_root",
|
|
"options": {"width": "100%", "height": "100%", "bgcolor": "var(--sage-bg-primary, transparent)"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VScrollPanel",
|
|
"options": {"css": "filler"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "alignItems": "center", "marginBottom": "12px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title2", "options": {"fontWeight": "700", "otext": "数据概览", "i18n": true}},
|
|
{"widgettype": "Filler"}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "gap": "16px", "marginBottom": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "RefreshWidget", "id": "stat_today_usage", "options": {"period_seconds": 30, "url": "{{entire_url('stat_today_usage.ui')}}", "width": "16%"}},
|
|
{"widgettype": "RefreshWidget", "id": "stat_today_amount", "options": {"period_seconds": 30, "url": "{{entire_url('stat_today_amount.ui')}}", "width": "16%"}},
|
|
{"widgettype": "RefreshWidget", "id": "stat_success_rate", "options": {"period_seconds": 60, "url": "{{entire_url('stat_success_rate.ui')}}", "width": "16%"}},
|
|
{"widgettype": "RefreshWidget", "id": "stat_fail_calls", "options": {"period_seconds": 60, "url": "{{entire_url('stat_fail_calls.ui')}}", "width": "16%"}},
|
|
{"widgettype": "RefreshWidget", "id": "stat_avg_ttft", "options": {"period_seconds": 60, "url": "{{entire_url('stat_avg_ttft.ui')}}", "width": "16%"}},
|
|
{"widgettype": "RefreshWidget", "id": "stat_total_users", "options": {"period_seconds": 60, "url": "{{entire_url('stat_total_users.ui')}}", "width": "16%"}}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "gap": "16px", "marginBottom": "16px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"css": "card", "width": "50%", "padding": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "模型性能排行", "i18n": true, "marginBottom": "8px"}},
|
|
{
|
|
"widgettype": "Cols",
|
|
"options": {
|
|
"col_cwidth": 24,
|
|
"data_url": "{{entire_url('api/model_perf.dspy')}}",
|
|
"data_params": {},
|
|
"record_view": {
|
|
"widgettype": "HBox",
|
|
"options": {"cheight": 3, "width": "100%"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "${model}", "width": "35%"}},
|
|
{"widgettype": "Text", "options": {"text": "${avg_ttft_ms}ms", "width": "15%"}},
|
|
{"widgettype": "Text", "options": {"text": "${success_rate}%", "width": "15%"}},
|
|
{"widgettype": "Text", "options": {"text": "${total_calls}", "width": "15%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${total_amount}", "width": "20%"}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"css": "card", "width": "50%", "padding": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "供应商性价比", "i18n": true, "marginBottom": "8px"}},
|
|
{
|
|
"widgettype": "Cols",
|
|
"options": {
|
|
"col_cwidth": 24,
|
|
"data_url": "{{entire_url('api/provider_roi.dspy')}}",
|
|
"data_params": {},
|
|
"record_view": {
|
|
"widgettype": "HBox",
|
|
"options": {"cheight": 3, "width": "100%"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "${model}", "width": "35%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${unit_price}/t", "width": "20%"}},
|
|
{"widgettype": "Text", "options": {"text": "${avg_ttft_ms}ms", "width": "15%"}},
|
|
{"widgettype": "Text", "options": {"text": "${total_calls}次", "width": "15%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${total_amount}", "width": "15%"}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "gap": "16px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"css": "card", "width": "33%", "padding": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "热门模型", "i18n": true, "marginBottom": "8px"}},
|
|
{
|
|
"widgettype": "Cols",
|
|
"options": {
|
|
"col_cwidth": 20,
|
|
"data_url": "{{entire_url('api/top_models.dspy')}}",
|
|
"data_params": {},
|
|
"record_view": {
|
|
"widgettype": "HBox",
|
|
"options": {"cheight": 3, "width": "100%"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "${model_name}", "width": "50%"}},
|
|
{"widgettype": "Text", "options": {"text": "${cnt}次", "width": "25%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${total_amount}", "width": "25%"}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"css": "card", "width": "33%", "padding": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "用户排行", "i18n": true, "marginBottom": "8px"}},
|
|
{
|
|
"widgettype": "Cols",
|
|
"options": {
|
|
"col_cwidth": 20,
|
|
"data_url": "{{entire_url('api/top_users.dspy')}}",
|
|
"data_params": {},
|
|
"record_view": {
|
|
"widgettype": "HBox",
|
|
"options": {"cheight": 3, "width": "100%"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "${user_name}", "width": "50%"}},
|
|
{"widgettype": "Text", "options": {"text": "${cnt}次", "width": "25%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${total_amount}", "width": "25%"}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"css": "card", "width": "33%", "padding": "16px"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title4", "options": {"fontWeight": "600", "otext": "供应商排行", "i18n": true, "marginBottom": "8px"}},
|
|
{
|
|
"widgettype": "Cols",
|
|
"options": {
|
|
"col_cwidth": 20,
|
|
"data_url": "{{entire_url('api/top_providers.dspy')}}",
|
|
"data_params": {},
|
|
"record_view": {
|
|
"widgettype": "HBox",
|
|
"options": {"cheight": 3, "width": "100%"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "${provider_name}", "width": "50%"}},
|
|
{"widgettype": "Text", "options": {"text": "${cnt}次", "width": "25%"}},
|
|
{"widgettype": "Text", "options": {"text": "¥${total_amount}", "width": "25%"}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|