diff --git a/src/lib/sdk/usage.ts b/src/lib/sdk/usage.ts index 948f13b12..b446bfa50 100644 --- a/src/lib/sdk/usage.ts +++ b/src/lib/sdk/usage.ts @@ -323,8 +323,13 @@ export type UsageProject = { */ authPhoneCountriesBreakdown: Models.MetricBreakdown[]; + /** + * Array of image transformations per period. + */ + imageTransformations: Metric[]; + /** * Aggregated statistics of total number of image transformations. */ - imageTransformations: number; + imageTransformationsTotal: number; }; diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index 24d5fae5c..1759f1287 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -272,34 +272,33 @@ {#if data.organizationUsage.imageTransformationsTotal} {@const current = data.organizationUsage.imageTransformationsTotal} {@const max = getServiceLimit('imageTransformations', tier, plan)} -
- - + [e.date, e.value] - ) - ] - } - ]} /> -
+ } + }} + series={[ + { + name: 'Image Transformations', + data: [ + ...(data.organizationUsage.imageTransformations ?? []).map((e) => [ + e.date, + e.value + ]) + ] + } + ]} /> {#if projects?.length > 0} {/if} diff --git a/src/routes/(console)/project-[project]/settings/usage/[[invoice]]/+page.svelte b/src/routes/(console)/project-[project]/settings/usage/[[invoice]]/+page.svelte index 91ce093af..cbc524656 100644 --- a/src/routes/(console)/project-[project]/settings/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/project-[project]/settings/usage/[[invoice]]/+page.svelte @@ -36,10 +36,10 @@ data.usage.filesStorageTotal + data.usage.deploymentsStorageTotal + data.usage.buildsStorageTotal; - + $: imageTransformations = data.usage.imageTransformations; + $: imageTransformationsTotal = data.usage.imageTransformationsTotal; $: dbReads = data.usage.databasesReads; $: dbWrites = data.usage.databasesWrites; - $: imageTransformations = data.usage.imageTransformations; $: legendData = [ { name: 'Reads', value: data.usage.databasesReadsTotal }, @@ -254,22 +254,29 @@ {#if imageTransformations} -
- [e.date, e.value])] - } - ]} /> + {@const current = formatNum(imageTransformationsTotal)} +
+
+

+ {current} + Transformations +

+
+ [e.date, e.value])] + } + ]} /> {:else}