diff --git a/src/components/usage/ApiDetailsCard.tsx b/src/components/usage/ApiDetailsCard.tsx index 6e93436..aba6b60 100644 --- a/src/components/usage/ApiDetailsCard.tsx +++ b/src/components/usage/ApiDetailsCard.tsx @@ -59,7 +59,7 @@ export function ApiDetailsCard({ apiStats, loading, hasPrices }: ApiDetailsCardP sortKey === key ? (sortDir === 'asc' ? ' ▲' : ' ▼') : ''; return ( - + {loading ? (
{t('common.loading')}
) : sorted.length > 0 ? ( @@ -82,70 +82,72 @@ export function ApiDetailsCard({ apiStats, loading, hasPrices }: ApiDetailsCardP ))} -
- {sorted.map((api, index) => { - const isExpanded = expandedApis.has(api.endpoint); - const panelId = `api-models-${index}`; +
+
+ {sorted.map((api, index) => { + const isExpanded = expandedApis.has(api.endpoint); + const panelId = `api-models-${index}`; - return ( -
- - {isExpanded && ( -
- {Object.entries(api.models).map(([model, stats]) => ( -
- {model} - - {stats.requests.toLocaleString()} + + {t('usage_stats.requests_count')}: {api.totalRequests.toLocaleString()} + - ({stats.successCount.toLocaleString()}{' '} - {stats.failureCount.toLocaleString()}) + ({api.successCount.toLocaleString()}{' '} + {api.failureCount.toLocaleString()}) - {formatCompactNumber(stats.tokens)} + + {t('usage_stats.tokens_count')}: {formatCompactNumber(api.totalTokens)} + + {hasPrices && api.totalCost > 0 && ( + + {t('usage_stats.total_cost')}: {formatUsd(api.totalCost)} + + )}
- ))} -
- )} -
- ); - })} +
+ + {isExpanded ? '▼' : '▶'} + + + {isExpanded && ( +
+ {Object.entries(api.models).map(([model, stats]) => ( +
+ {model} + + + {stats.requests.toLocaleString()} + + ({stats.successCount.toLocaleString()}{' '} + {stats.failureCount.toLocaleString()}) + + + + {formatCompactNumber(stats.tokens)} +
+ ))} +
+ )} +
+ ); + })} +
) : (