增加请求次数

This commit is contained in:
2025-08-10 04:43:19 +08:00
parent 6898f10d3f
commit e5e7399f90

View File

@@ -330,7 +330,7 @@ export const UsageDashboard: React.FC<UsageDashboardProps> = ({ onBack }) => {
cacheReadTokens: (day.cache_read_tokens || 0) / 1000, cacheReadTokens: (day.cache_read_tokens || 0) / 1000,
requests: day.request_count || 0, requests: day.request_count || 0,
}))} }))}
margin={{ top: 5, right: 60, left: 20, bottom: 40 }} margin={{ top: 5, right: 80, left: 20, bottom: 40 }}
> >
<CartesianGrid strokeDasharray="3 3" className="stroke-border/20" /> <CartesianGrid strokeDasharray="3 3" className="stroke-border/20" />
<XAxis <XAxis
@@ -356,6 +356,14 @@ export const UsageDashboard: React.FC<UsageDashboardProps> = ({ onBack }) => {
label={{ value: 'Cost (USD)', angle: 90, position: 'insideRight', style: { fontSize: 10 } }} label={{ value: 'Cost (USD)', angle: 90, position: 'insideRight', style: { fontSize: 10 } }}
className="text-muted-foreground" className="text-muted-foreground"
/> />
<YAxis
yAxisId="requests"
orientation="right"
tick={{ fontSize: 10 }}
tickFormatter={(value) => `${value}`}
label={{ value: 'Requests', angle: 90, position: 'insideRight', dx: 40, style: { fontSize: 10 } }}
className="text-muted-foreground"
/>
<RechartsTooltip <RechartsTooltip
contentStyle={{ contentStyle={{
backgroundColor: 'hsl(var(--popover))', backgroundColor: 'hsl(var(--popover))',
@@ -481,6 +489,17 @@ export const UsageDashboard: React.FC<UsageDashboardProps> = ({ onBack }) => {
dot={{ r: 3 }} dot={{ r: 3 }}
activeDot={{ r: 5 }} activeDot={{ r: 5 }}
/> />
{/* 请求数线条 - 请求轴 */}
<Line
yAxisId="requests"
type="monotone"
dataKey="requests"
stroke="#f59e0b"
strokeWidth={2}
dot={{ r: 2.5 }}
activeDot={{ r: 4.5 }}
/>
</LineChart> </LineChart>
</ResponsiveContainer> </ResponsiveContainer>
</div> </div>