|
1 | 1 | <script lang="ts">
|
2 |
| - import { Container } from '$lib/layout'; |
3 |
| - import { CardGrid, Heading, Card, ProgressBarBig } from '$lib/components'; |
| 2 | + import { base } from '$app/paths'; |
| 3 | + import { BarChart, Legend } from '$lib/charts'; |
| 4 | + import { Card, CardGrid, Heading, ProgressBarBig } from '$lib/components'; |
| 5 | + import Collapsible from '$lib/components/collapsible.svelte'; |
| 6 | + import CollapsibleItem from '$lib/components/collapsibleItem.svelte'; |
| 7 | + import { BillingPlan } from '$lib/constants.js'; |
| 8 | + import { Button } from '$lib/elements/forms'; |
4 | 9 | import {
|
5 |
| - TableRow, |
| 10 | + Table, |
6 | 11 | TableBody,
|
7 | 12 | TableCell,
|
8 | 13 | TableCellHead,
|
9 | 14 | TableHeader,
|
10 |
| - Table, |
| 15 | + TableRow, |
11 | 16 | TableRowLink
|
12 | 17 | } from '$lib/elements/table';
|
13 |
| - import { showUsageRatesModal, tierToPlan, upgradeURL } from '$lib/stores/billing'; |
14 |
| - import { organization } from '$lib/stores/organization'; |
15 |
| - import { Button } from '$lib/elements/forms'; |
| 18 | + import { getCountryName } from '$lib/helpers/diallingCodes.js'; |
| 19 | + import { formatCurrency, formatNumberWithCommas } from '$lib/helpers/numbers'; |
16 | 20 | import { bytesToSize, humanFileSize, mbSecondsToGBHours } from '$lib/helpers/sizeConvertion';
|
17 |
| - import { BarChart, Legend } from '$lib/charts'; |
18 | 21 | import { formatNum } from '$lib/helpers/string';
|
| 22 | + import { Container } from '$lib/layout'; |
19 | 23 | import { total } from '$lib/layout/usage.svelte';
|
20 |
| - import { BillingPlan } from '$lib/constants.js'; |
21 |
| - import { base } from '$app/paths'; |
22 |
| - import { formatCurrency, formatNumberWithCommas } from '$lib/helpers/numbers'; |
23 |
| - import Collapsible from '$lib/components/collapsible.svelte'; |
24 |
| - import CollapsibleItem from '$lib/components/collapsibleItem.svelte'; |
25 |
| - import { getCountryName } from '$lib/helpers/diallingCodes.js'; |
| 24 | + import { showUsageRatesModal, tierToPlan, upgradeURL } from '$lib/stores/billing'; |
| 25 | + import { organization } from '$lib/stores/organization'; |
26 | 26 |
|
27 | 27 | export let data;
|
28 | 28 |
|
|
39 | 39 |
|
40 | 40 | $: dbReads = data.usage.databasesReads;
|
41 | 41 | $: dbWrites = data.usage.databasesWrites;
|
| 42 | + $: imageTransformations = data.usage.imageTransformations; |
42 | 43 |
|
43 | 44 | $: legendData = [
|
44 | 45 | { name: 'Reads', value: data.usage.databasesReadsTotal },
|
|
246 | 247 | {/if}
|
247 | 248 | </svelte:fragment>
|
248 | 249 | </CardGrid>
|
| 250 | + <CardGrid> |
| 251 | + <Heading tag="h6" size="7">Image transformations</Heading> |
| 252 | + |
| 253 | + <p class="text">Total image transformations in your project.</p> |
| 254 | + |
| 255 | + <svelte:fragment slot="aside"> |
| 256 | + {#if imageTransformations} |
| 257 | + <div style:margin-top="-1.5em" style:margin-bottom="-1em"> |
| 258 | + <BarChart |
| 259 | + options={{ |
| 260 | + yAxis: { |
| 261 | + axisLabel: { |
| 262 | + formatter: formatNum |
| 263 | + } |
| 264 | + } |
| 265 | + }} |
| 266 | + series={[ |
| 267 | + { |
| 268 | + name: 'Image transformations', |
| 269 | + data: [...imageTransformations.map((e) => [e.date, e.value])] |
| 270 | + } |
| 271 | + ]} /> |
| 272 | + </div> |
| 273 | + {:else} |
| 274 | + <Card isDashed> |
| 275 | + <div class="u-flex u-cross-center u-flex-vertical u-main-center u-flex"> |
| 276 | + <span |
| 277 | + class="icon-chart-square-bar text-large" |
| 278 | + aria-hidden="true" |
| 279 | + style="font-size: 32px;" /> |
| 280 | + <p class="u-bold">No data to show</p> |
| 281 | + </div> |
| 282 | + </Card> |
| 283 | + {/if} |
| 284 | + </svelte:fragment> |
| 285 | + </CardGrid> |
249 | 286 | <CardGrid>
|
250 | 287 | <Heading tag="h6" size="7">Executions</Heading>
|
251 | 288 |
|
|
0 commit comments