From 6b73f5b6b926e00319f31663ea9dc63ad18bb404 Mon Sep 17 00:00:00 2001 From: wxj Date: Tue, 30 Jun 2026 11:04:27 +0800 Subject: [PATCH] =?UTF-8?q?Token=20=E4=BD=BF=E7=94=A8=E8=B6=8B=E5=8A=BF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=A0=8F=EF=BC=9A=E7=B2=92=E5=BA=A6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E4=B8=8E=E5=88=B7=E6=96=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/dashboard/BentoTrend.jsx | 47 ++++++++++++++++++++- web/src/components/dashboard/index.jsx | 2 + 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/web/src/components/dashboard/BentoTrend.jsx b/web/src/components/dashboard/BentoTrend.jsx index 2b2609d..912bfd7 100644 --- a/web/src/components/dashboard/BentoTrend.jsx +++ b/web/src/components/dashboard/BentoTrend.jsx @@ -17,8 +17,8 @@ along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ -import React, { useMemo } from 'react'; -import { TrendingUp } from 'lucide-react'; +import React, { useMemo, useState } from 'react'; +import { TrendingUp, RefreshCw, ChevronDown } from 'lucide-react'; import Sparkline from './Sparkline'; import { renderQuota } from '../../helpers'; @@ -28,11 +28,21 @@ const formatMD = (d) => { return `${m}/${day}`; }; +const GRANULARITY = [ + { value: 'hour', label: '按小时' }, + { value: 'day', label: '按天' }, + { value: 'week', label: '按周' }, + { value: 'month', label: '按月' }, +]; + const BentoTrend = ({ dailyStats = [], topModels = [], className = '', + onRefresh, + loading = false, }) => { + const [granularity, setGranularity] = useState('day'); const counts = useMemo(() => dailyStats.map((d) => d.count), [dailyStats]); const costs = useMemo(() => dailyStats.map((d) => d.cost), [dailyStats]); @@ -71,6 +81,39 @@ const BentoTrend = ({ +
+
+ + 近 7 天 + + +
+
+ 粒度 +
+ + +
+
+
+
diff --git a/web/src/components/dashboard/index.jsx b/web/src/components/dashboard/index.jsx index 16f9c49..602186d 100644 --- a/web/src/components/dashboard/index.jsx +++ b/web/src/components/dashboard/index.jsx @@ -64,6 +64,8 @@ const Dashboard = () => {