mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-12 14:10:19 +08:00
fix(pool): show Antigravity quota reset times
This commit is contained in:
@@ -99,7 +99,7 @@ describe('pool key display panels', () => {
|
||||
label: 'Gemini额度',
|
||||
remainingPercent: 90.6,
|
||||
resetText: '1h 后重置',
|
||||
meterText: '90.6–100',
|
||||
meterText: '90.6%–100%',
|
||||
barClass: 'bg-emerald-500',
|
||||
meterClass: 'text-emerald-600',
|
||||
},
|
||||
@@ -107,7 +107,7 @@ describe('pool key display panels', () => {
|
||||
label: 'Claude额度',
|
||||
remainingPercent: 100,
|
||||
resetText: '1h 后重置',
|
||||
meterText: '100',
|
||||
meterText: '100%',
|
||||
barClass: 'bg-emerald-500',
|
||||
meterClass: 'text-emerald-600',
|
||||
},
|
||||
@@ -121,8 +121,12 @@ describe('pool key display panels', () => {
|
||||
'Gemini额度',
|
||||
'Claude额度',
|
||||
])
|
||||
expect(Array.from(root.querySelectorAll('[data-testid="pool-quota-meter-text"]')).map(node => node.textContent)).toEqual(['90.6–100', '100'])
|
||||
expect(Array.from(root.querySelectorAll('[data-testid="pool-quota-meter-text"]')).map(node => node.textContent)).toEqual(['90.6%–100%', '100%'])
|
||||
expect(root.querySelectorAll('[data-testid="pool-quota-progress-track"]')).toHaveLength(2)
|
||||
expect(Array.from(root.querySelectorAll('[data-testid="pool-quota-reset-text"]')).map(node => node.textContent)).toEqual([
|
||||
'1h 后重置',
|
||||
'1h 后重置',
|
||||
])
|
||||
|
||||
app.unmount()
|
||||
root.remove()
|
||||
|
||||
@@ -15,9 +15,10 @@ describe('summarizeAntigravityQuotaItems', () => {
|
||||
])
|
||||
|
||||
expect(items.map(item => [item.label, item.remainingPercent, item.detail])).toEqual([
|
||||
['Gemini额度', 90.6, '90.6–95'],
|
||||
['Claude额度', 82, '82–100'],
|
||||
['Gemini额度', 90.6, '90.6%–95%'],
|
||||
['Claude额度', 82, '82%–100%'],
|
||||
])
|
||||
expect(items.map(item => item.resetSeconds)).toEqual([180, 120])
|
||||
expect(items[1]?.model).toBe('claude-sonnet-4-6')
|
||||
})
|
||||
})
|
||||
@@ -158,5 +158,6 @@ export function summarizeAntigravityQuotaItems<T extends AntigravityQuotaSortabl
|
||||
|
||||
function formatAntigravityQuotaValue(value: number): string {
|
||||
const rounded = Math.round(value)
|
||||
return Math.abs(value - rounded) < 1e-6 ? String(rounded) : value.toFixed(1)
|
||||
const formatted = Math.abs(value - rounded) < 1e-6 ? String(rounded) : value.toFixed(1)
|
||||
return `${formatted}%`
|
||||
}
|
||||
|
||||
@@ -3883,12 +3883,6 @@ function buildQuotaProgressItemsFromSnapshot(key: PoolKeyDetail): QuotaProgressI
|
||||
}
|
||||
})
|
||||
.filter((item): item is QuotaProgressItem & { model: string, resetSeconds: number | null } => item != null)))
|
||||
.map(item => ({
|
||||
...item,
|
||||
resetAtSeconds: null,
|
||||
resetSeconds: null,
|
||||
allowDynamicReset: false,
|
||||
}))
|
||||
}
|
||||
|
||||
if (providerType === 'gemini_cli') {
|
||||
|
||||
Reference in New Issue
Block a user