fix: Rename limit to cost and allow for 0 limit

- Rename `额度` column to `费用`
- Allow for a quota to be 0.
- If the quota is 0, return 'free'
This commit is contained in:
Laisky.Cai 2024-03-02 00:59:22 +00:00
parent 06350ae5a2
commit 268690219e
2 changed files with 6 additions and 2 deletions

View File

@ -124,7 +124,11 @@ export function timestamp2string(timestamp) {
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
}
export function calculateQuota(quota, digits = 2) {
export function calculateQuota(quota = 0, digits = 2) {
if (!quota || quota === 0) {
return 'free';
}
let quotaPerUnit = localStorage.getItem('quota_per_unit');
quotaPerUnit = parseFloat(quotaPerUnit);

View File

@ -13,7 +13,7 @@ const LogTableHead = ({ userIsAdmin }) => {
<TableCell>模型</TableCell>
<TableCell>提示</TableCell>
<TableCell>补全</TableCell>
<TableCell>额度</TableCell>
<TableCell>费用</TableCell>
<TableCell>详情</TableCell>
</TableRow>
</TableHead>