diff --git a/src/pages/QuotaPage.css b/src/pages/QuotaPage.css index b5545c5..606b304 100644 --- a/src/pages/QuotaPage.css +++ b/src/pages/QuotaPage.css @@ -64,3 +64,5 @@ .quota-page .quota-reset-footer { order: 3; align-self: flex-end; margin: auto 0 0; min-height: 30px; padding: 5px 10px; border-radius: 7px; color: #347df4; border-color: #d8e5fb; background: #f3f7ff; } .quota-page .quota-reset-footer:hover:not(:disabled) { border-color: #9dbcf4; background: #eaf2ff; } .quota-page .quota-card-message, .quota-page .quota-card-error { min-height: 36px; flex-wrap: wrap; } +.quota-page .quota-card-error > span { display: grid; gap: 4px; min-width: 0; } +.quota-page .quota-card-error small { overflow-wrap: anywhere; font-size: 11px; } diff --git a/src/pages/QuotaPage.tsx b/src/pages/QuotaPage.tsx index b5b1731..60fc9ec 100644 --- a/src/pages/QuotaPage.tsx +++ b/src/pages/QuotaPage.tsx @@ -204,8 +204,7 @@ export function QuotaCard({ file, quota, onRefresh, onReset }: { file: AuthFile; {quota.status === 'idle' ?
{disabled ? t('quota.fileDisabled') : t('quota.notFetched')}
: null} {quota.status === 'loading' ?
{t(quota.pendingAction === 'reset' ? 'quota.resetting' : 'quota.querying')}
: null} {quota.status === 'error' ? <> - -
{t('authFiles.quota.failed')}
+
{t('authFiles.quota.failed')}{quota.error ? {quota.error} : null}
: null} {quota.status === 'success' && (provider === 'codex' || provider === 'claude') ?
{(quota.creditsUnlimited || quota.creditBalance !== undefined) ? {t('quota.creditBalance')} {quota.creditsUnlimited ? t('quota.creditUnlimited') : quota.creditBalance} : null} diff --git a/tests/quotaRendering.test.tsx b/tests/quotaRendering.test.tsx index 6c87b6c..5e58a08 100644 --- a/tests/quotaRendering.test.tsx +++ b/tests/quotaRendering.test.tsx @@ -60,4 +60,10 @@ describe('quota card rendering', () => { expect(html).toContain('Reset time reached; refresh to verify'); expect(html).toContain('0% remaining'); }); + + it('Kimi 免费账号取不到额度时只显示卡片内失败状态', () => { + const html = render({ status: 'error', rows: [], error: 'free account cannot access quota' }, 'kimi'); + expect(html).toContain('quota-card-error'); + expect(html).not.toContain('app-notice-entry'); + }); });