diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index c479f5d..5f3e4ab 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -6,7 +6,7 @@ import * as echarts from 'echarts/core' import { LineChart, BarChart } from 'echarts/charts' import { GridComponent, TooltipComponent, TitleComponent, LegendComponent } from 'echarts/components' import { CanvasRenderer } from 'echarts/renderers' -import { UserOutlined, BookOutlined, CloudOutlined, FileOutlined, ClusterOutlined } from '@ant-design/icons' +import { UserOutlined, BookOutlined, CloudOutlined, FileOutlined, ClusterOutlined, DollarOutlined, ImportOutlined, AlertOutlined, SafetyOutlined } from '@ant-design/icons' import dayjs from 'dayjs' import MetricCard from '@/components/MetricCard' import { Progress, Space } from 'antd' @@ -61,6 +61,12 @@ export default function Dashboard() { } /> } suffix={`${stats?.totalFiles ?? 0} 个文件`} /> + + } trend="up" trendValue={`${stats?.totalAiCallsToday ?? 0} 次`} trendLabel="今日调用" /> + } trend={stats?.failedImportCount ? 'down' : 'up'} trendValue={stats?.failedImportCount ? `${stats.failedImportCount} 失败` : '全部成功'} trendLabel="状态" /> + } trend={stats?.failedTasks ? 'down' : 'up'} trendValue={stats?.failedTasks ? '需要关注' : '无异常'} trendLabel="7 天内" /> + } trend={stats?.upcomingExpirations ? 'down' : 'up'} trendValue="30 天内" trendLabel="到期" /> + diff --git a/src/types/admin.ts b/src/types/admin.ts index d9de3b4..3c1979f 100644 --- a/src/types/admin.ts +++ b/src/types/admin.ts @@ -26,6 +26,11 @@ export interface DashboardStats { totalAiCallsToday: number totalFiles: number totalStorageBytes: number + todayImportCount: number + failedImportCount: number + todayAiCost: number + failedTasks: number + upcomingExpirations: number userTrend: TrendPoint[] aiCallTrend: TrendPoint[] }