Merge pull request #15322 from Budibase/cheeks-fixes
Fix usage calculations
This commit is contained in:
commit
2391bfd15b
|
@ -227,7 +227,7 @@ class LicensingStore extends BudiStore<LicensingState> {
|
||||||
MonthlyQuotaName.AUTOMATIONS,
|
MonthlyQuotaName.AUTOMATIONS,
|
||||||
].reduce((acc: MonthlyMetrics, key) => {
|
].reduce((acc: MonthlyMetrics, key) => {
|
||||||
const limit = license.quotas.usage.monthly[key].value
|
const limit = license.quotas.usage.monthly[key].value
|
||||||
const used = (usage.monthly.current?.[key] || 0 / limit) * 100
|
const used = ((usage.monthly.current?.[key] || 0) / limit) * 100
|
||||||
acc[key] = limit > -1 ? Math.floor(used) : -1
|
acc[key] = limit > -1 ? Math.floor(used) : -1
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
@ -236,7 +236,7 @@ class LicensingStore extends BudiStore<LicensingState> {
|
||||||
const staticMetrics = [StaticQuotaName.APPS, StaticQuotaName.ROWS].reduce(
|
const staticMetrics = [StaticQuotaName.APPS, StaticQuotaName.ROWS].reduce(
|
||||||
(acc: StaticMetrics, key) => {
|
(acc: StaticMetrics, key) => {
|
||||||
const limit = license.quotas.usage.static[key].value
|
const limit = license.quotas.usage.static[key].value
|
||||||
const used = (usage.usageQuota[key] || 0 / limit) * 100
|
const used = ((usage.usageQuota[key] || 0) / limit) * 100
|
||||||
acc[key] = limit > -1 ? Math.floor(used) : -1
|
acc[key] = limit > -1 ? Math.floor(used) : -1
|
||||||
return acc
|
return acc
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue