mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 18:23:40 +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:
@@ -38,6 +38,10 @@ export function renderNumber(num) {
|
||||
}
|
||||
|
||||
export function renderQuota(quota, digits = 2) {
|
||||
if (quota === 0) {
|
||||
return 'free';
|
||||
}
|
||||
|
||||
let quotaPerUnit = localStorage.getItem('quota_per_unit');
|
||||
let displayInCurrency = localStorage.getItem('display_in_currency');
|
||||
quotaPerUnit = parseFloat(quotaPerUnit);
|
||||
@@ -55,4 +59,4 @@ export function renderQuotaWithPrompt(quota, digits) {
|
||||
return `(等价金额:${renderQuota(quota, digits)})`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user