🎨 refactor: Refactor dashboard statistics cards and charts layout

- Consolidate 8 individual stat cards into 4 grouped cards:
  * Account Data (Current Balance, Historical Consumption)
  * Usage Statistics (Request Count, Statistics Count)
  * Resource Consumption (Statistics Quota, Statistics Tokens)
  * Performance Metrics (Average RPM, Average TPM)

- Add gradient header backgrounds with white text for card titles:
  * Blue gradient for Account Data
  * Green gradient for Usage Statistics
  * Yellow gradient for Resource Consumption
  * Pink gradient for Performance Metrics

- Implement mini trend charts using real API data:
  * Replace mock data with actual time-series data from API
  * Hide x and y axes to show pure trend lines
  * Display trends only for metrics with available historical data
  * Remove trend charts for Current Balance, Historical Consumption, and Request Count

- Merge model analysis charts into single card:
  * Combine "Model Consumption Distribution" and "Model Call Count Ratio"
  * Use responsive grid layout (vertical on mobile, horizontal on desktop)
  * Update card title to "Model Data Analysis"

- Optimize chart configurations:
  * Hide axes, legends, and tooltips for mini trend charts
  * Maintain color consistency between metrics and trend lines
  * Improve performance by processing all trend data in single API call
This commit is contained in:
Apple\Apple
2025-06-07 00:53:29 +08:00
parent 12f104337b
commit 1c3cd7984c
10 changed files with 297 additions and 196 deletions

View File

@@ -241,7 +241,7 @@ const ModelPricing = () => {
let price = parseFloat(text) * groupRatio[selectedGroup];
content = (
<div className="text-gray-700">
${t('模型价格')}${price.toFixed(3)}
{t('模型价格')}${price.toFixed(3)}
</div>
);
}
@@ -451,7 +451,7 @@ const ModelPricing = () => {
// 搜索和操作区组件
const SearchAndActions = useMemo(() => (
<Card className="!rounded-xl mb-6" shadows='hover'>
<Card className="!rounded-xl mb-6" bordered={false}>
<div className="flex flex-wrap items-center gap-4">
<div className="flex-1 min-w-[200px]">
<Input
@@ -482,7 +482,7 @@ const ModelPricing = () => {
// 表格组件
const ModelTable = useMemo(() => (
<Card className="!rounded-xl overflow-hidden" shadows='hover'>
<Card className="!rounded-xl overflow-hidden" bordered={false}>
<Table
columns={columns}
dataSource={filteredModels}