From 40f1bb30670e79bea73a3ebc8fffc5b9cfb9d52a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 14 Sep 2022 20:58:58 +0100 Subject: [PATCH] Update usage page --- .../builder/portal/settings/usage.svelte | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/usage.svelte b/packages/builder/src/pages/builder/portal/settings/usage.svelte index 41a01e3cd3..f2809452fd 100644 --- a/packages/builder/src/pages/builder/portal/settings/usage.svelte +++ b/packages/builder/src/pages/builder/portal/settings/usage.svelte @@ -25,7 +25,8 @@ const upgradeUrl = `${$admin.accountPortalUrl}/portal/upgrade` const manageUrl = `${$admin.accountPortalUrl}/portal/billing` - const warnUsage = ["Queries", "Automations", "Rows", "Day Passes"] + const WARN_USAGE = ["Queries", "Automations", "Rows", "Day Passes"] + const EXCLUDE_QUOTAS = ["Queries"] $: quotaUsage = $licensing.quotaUsage $: license = $auth.user?.license @@ -36,11 +37,14 @@ monthlyUsage = [] if (quotaUsage.monthly) { for (let [key, value] of Object.entries(license.quotas.usage.monthly)) { + if (EXCLUDE_QUOTAS.includes(value.name)) { + continue + } const used = quotaUsage.monthly.current[key] - if (used !== undefined) { + if (value.value !== 0) { monthlyUsage.push({ name: value.name, - used: used, + used: used ? used : 0, total: value.value, }) } @@ -52,11 +56,14 @@ const setStaticUsage = () => { staticUsage = [] for (let [key, value] of Object.entries(license.quotas.usage.static)) { + if (EXCLUDE_QUOTAS.includes(value.name)) { + continue + } const used = quotaUsage.usageQuota[key] - if (used !== undefined) { + if (value.value !== 0) { staticUsage.push({ name: value.name, - used: used, + used: used ? used : 0, total: value.value, }) } @@ -199,7 +206,7 @@
{/each} @@ -222,7 +229,7 @@
{/each}