mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 16:36:40 -07:00
refactor(cli): consolidate quota reset formatting and restore conservative defaults
This commit is contained in:
@@ -85,13 +85,7 @@ export const QuotaStatsInfo: React.FC<QuotaStatsInfoProps> = ({
|
||||
: `${displayPercentage.toFixed(0)}%`}
|
||||
</Text>
|
||||
{displayPercentage !== 0 && <Text> usage remaining</Text>}
|
||||
{displayResetTime &&
|
||||
`, ${(function (t) {
|
||||
const formatted = formatResetTime(t);
|
||||
return formatted === 'Resetting...' || formatted === '< 1m'
|
||||
? formatted
|
||||
: `resets in ${formatted}`;
|
||||
})(displayResetTime)}`}
|
||||
{displayResetTime && `, ${formatResetTime(displayResetTime)}`}
|
||||
</Text>
|
||||
)}
|
||||
{showDetails && (
|
||||
|
||||
@@ -278,7 +278,13 @@ const ModelUsageTable: React.FC<{
|
||||
</Text>
|
||||
</Box>
|
||||
<Box width={tokenColumnWidth} justifyContent="flex-end">
|
||||
<Text color={theme.text.secondary}>{row.cachedTokens}</Text>
|
||||
<Text
|
||||
color={
|
||||
row.isActive ? theme.text.primary : theme.text.secondary
|
||||
}
|
||||
>
|
||||
{row.cachedTokens}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box width={tokenColumnWidth} justifyContent="flex-end">
|
||||
<Text
|
||||
@@ -294,19 +300,19 @@ const ModelUsageTable: React.FC<{
|
||||
{showQuotaColumn && (
|
||||
<Box flexGrow={1} justifyContent="flex-end">
|
||||
{row.bucket && row.bucket.remainingFraction != null && (
|
||||
<Text color={theme.text.secondary}>
|
||||
<Text
|
||||
color={
|
||||
row.isActive ? theme.text.primary : theme.text.secondary
|
||||
}
|
||||
>
|
||||
{(row.bucket.remainingFraction * 100).toFixed(1)}%
|
||||
{row.bucket.resetTime && (
|
||||
<Text color={theme.text.secondary}>
|
||||
{' '}
|
||||
(
|
||||
{(function (t) {
|
||||
const formatted = formatResetTime(t);
|
||||
return formatted === 'Resetting...' ||
|
||||
formatted === '< 1m'
|
||||
? formatted
|
||||
: `Resets in ${formatted}`;
|
||||
})(row.bucket.resetTime)}
|
||||
{formatResetTime(row.bucket.resetTime, {
|
||||
capitalize: true,
|
||||
})}
|
||||
)
|
||||
</Text>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user