chore: added image transformation breakdown

This commit is contained in:
ChiragAgg5k committed 2025-02-26 10:26:38 +05:30
1 parent 2258baaa9d
commit 586a51ebde
3 files changed
+13 -6

No files matched your search

+2 -2
View File
@@ -186,11 +186,11 @@ export type UsageBuckets = {
*/
storage: Metric[];
/**
* Aggregated statistics of bucket file transformations per period.
* Aggregated statistics of bucket image transformations per period.
*/
imageTransformations: Metric[];
/**
* Total aggregated number of file transformations.
* Total aggregated number of bucket image transformations.
*/
imageTransformationsTotal: number;
};
@@ -265,6 +265,9 @@
<p class="text">
The total number of image transformations across all projects in your organization.
</p>
{#if $organization.billingPlan === BillingPlan.FREE}
<p>This feature is not available on the Free plan.</p>
{/if}
<svelte:fragment slot="aside">
{#if data.organizationUsage.imageTransformationsTotal}
{@const current = data.organizationUsage.imageTransformationsTotal}
@@ -273,7 +276,7 @@
<ProgressBarBig
currentUnit="Transformations"
currentValue={formatNum(current)}
maxUnit="Transformations"
maxUnit="transformations"
maxValue={`out of ${formatNum(max)}`}
progressValue={current}
progressMax={max}
@@ -297,6 +300,9 @@
}
]} />
</div>
{#if projects?.length > 0}
<ProjectBreakdown {projects} metric="imageTransformations" {data} />
{/if}
{:else}
<Card isDashed>
<div class="u-flex u-cross-center u-flex-vertical u-main-center u-flex">
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
import { base } from '$app/paths';
import { Collapsible, CollapsibleItem } from '$lib/components';
import {
TableBody,
@@ -13,9 +13,9 @@
import { abbreviateNumber, formatCurrency, formatNumberWithCommas } from '$lib/helpers/numbers';
import { humanFileSize } from '$lib/helpers/sizeConvertion';
import type { OrganizationUsage } from '$lib/sdk/billing';
import { base } from '$app/paths';
import { canSeeProjects } from '$lib/stores/roles';
import { onMount } from 'svelte';
import type { PageData } from './$types';
type Metric =
| 'users'
@@ -24,7 +24,8 @@
| 'executions'
| 'authPhoneTotal'
| 'databasesReads'
| 'databasesWrites';
| 'databasesWrites'
| 'imageTransformations';
type Estimate = 'authPhoneEstimate';