mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-19 18:16:38 +08:00
fix: display issue for quota
- DRY up `LogsTable.js` codebase - Fix formatting in `LogsTable.js` - Display 'free' for a 0 quota instead of empty string
This commit is contained in:
parent
268690219e
commit
a7c43ab248
@ -319,7 +319,7 @@ const LogsTable = () => {
|
|||||||
}}
|
}}
|
||||||
width={1}
|
width={1}
|
||||||
>
|
>
|
||||||
额度
|
费用
|
||||||
</Table.HeaderCell>
|
</Table.HeaderCell>
|
||||||
<Table.HeaderCell
|
<Table.HeaderCell
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
|
@ -38,6 +38,10 @@ export function renderNumber(num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function renderQuota(quota, digits = 2) {
|
export function renderQuota(quota, digits = 2) {
|
||||||
|
if (quota === 0) {
|
||||||
|
return 'free';
|
||||||
|
}
|
||||||
|
|
||||||
let quotaPerUnit = localStorage.getItem('quota_per_unit');
|
let quotaPerUnit = localStorage.getItem('quota_per_unit');
|
||||||
let displayInCurrency = localStorage.getItem('display_in_currency');
|
let displayInCurrency = localStorage.getItem('display_in_currency');
|
||||||
quotaPerUnit = parseFloat(quotaPerUnit);
|
quotaPerUnit = parseFloat(quotaPerUnit);
|
||||||
@ -55,4 +59,4 @@ export function renderQuotaWithPrompt(quota, digits) {
|
|||||||
return `(等价金额:${renderQuota(quota, digits)})`;
|
return `(等价金额:${renderQuota(quota, digits)})`;
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user