From 268690219eca568a3b529c9e45f43baceea6b5ce Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Sat, 2 Mar 2024 00:59:22 +0000 Subject: [PATCH] fix: Rename limit to cost and allow for 0 limit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename `额度` column to `费用` - Allow for a quota to be 0. - If the quota is 0, return 'free' --- web/berry/src/utils/common.js | 6 +++++- web/berry/src/views/Log/component/TableHead.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/berry/src/utils/common.js b/web/berry/src/utils/common.js index 25e5c635..06395942 100644 --- a/web/berry/src/utils/common.js +++ b/web/berry/src/utils/common.js @@ -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); diff --git a/web/berry/src/views/Log/component/TableHead.js b/web/berry/src/views/Log/component/TableHead.js index 671170ce..072ac557 100644 --- a/web/berry/src/views/Log/component/TableHead.js +++ b/web/berry/src/views/Log/component/TableHead.js @@ -13,7 +13,7 @@ const LogTableHead = ({ userIsAdmin }) => { 模型 提示 补全 - 额度 + 费用 详情