Skip to content

Commit

Permalink
web/satellite/vuetify-poc: download total usage report
Browse files Browse the repository at this point in the history
Added CTA to billing -> overview screen for user to download total usage report

Issue:
#6154

Change-Id: I465c955486e6fa9bf922d56798b2338c4bd2d73f
  • Loading branch information
VitaliiShpital authored and Storj Robot committed Oct 17, 2023
1 parent d7af97c commit 45fdc64
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Expand Up @@ -4,7 +4,7 @@
<template>
<v-row>
<v-col>
<h4 class="mt-4">Costs per project</h4>
<h4>Costs per project</h4>
</v-col>
</v-row>

Expand Down
18 changes: 18 additions & 0 deletions web/satellite/vuetify-poc/src/views/Billing.vue
Expand Up @@ -144,6 +144,18 @@
</v-col>
</v-row>

<v-row>
<v-col>
<v-card title="Detailed Usage Report" subtitle="Get a complete usage report for all your projects." border>
<v-card-text>
<v-btn variant="outlined" color="default" size="small" @click="downloadReport">
Download Report
</v-btn>
</v-card-text>
</v-card>
</v-col>
</v-row>

<v-row v-if="isRollupLoading" justify="center" align="center">
<v-col cols="auto">
<v-progress-circular indeterminate />
Expand Down Expand Up @@ -223,6 +235,7 @@ import { AnalyticsErrorEventSource } from '@/utils/constants/analyticsEventNames
import { SHORT_MONTHS_NAMES } from '@/utils/constants/date';
import { useProjectsStore } from '@/store/modules/projectsStore';
import { useConfigStore } from '@/store/modules/configStore';
import { Download } from '@/utils/download';
import CreditCardComponent from '@poc/components/CreditCardComponent.vue';
import AddCreditCardComponent from '@poc/components/AddCreditCardComponent.vue';
Expand Down Expand Up @@ -316,6 +329,11 @@ const isCouponActive = computed((): boolean => {
return !!c && (c.duration === 'forever' || (!!c.expiresAt && now < c.expiresAt.getTime()));
});
function downloadReport(): void {
const link = projectsStore.getTotalUsageReportLink();
Download.fileByLink(link);
}
function goToTransactionsTab() {
tab.value = 2;
}
Expand Down

0 comments on commit 45fdc64

Please sign in to comment.