1<template> 2 <overview-card 3 :data="dumps" 4 :disabled="dumps.length === 0" 5 :download-button="true" 6 :file-name="exportFileNameByDate()" 7 :title="$t('pageOverview.dumps')" 8 :to="`/logs/dumps`" 9 > 10 <b-row class="mt-3"> 11 <b-col sm="6"> 12 <dl> 13 <dt>{{ $t('pageOverview.total') }}</dt> 14 <dd class="h3">{{ dataFormatter(dumps.length) }}</dd> 15 </dl> 16 </b-col> 17 </b-row> 18 </overview-card> 19</template> 20 21<script> 22import OverviewCard from './OverviewCard'; 23import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; 24import { useI18n } from 'vue-i18n'; 25 26export default { 27 name: 'Dumps', 28 components: { 29 OverviewCard, 30 }, 31 mixins: [DataFormatterMixin], 32 data() { 33 return { 34 $t: useI18n().t, 35 }; 36 }, 37 computed: { 38 dumps() { 39 return this.$store.getters['dumps/allDumps']; 40 }, 41 }, 42 created() { 43 this.$store.dispatch('dumps/getAllDumps').finally(() => { 44 this.$root.$emit('overview-dumps-complete'); 45 }); 46 }, 47 methods: { 48 exportFileNameByDate() { 49 // Create export file name based on date 50 let date = new Date(); 51 date = 52 date.toISOString().slice(0, 10) + 53 '_' + 54 date.toString().split(':').join('-').split(' ')[4]; 55 let fileName = 'all_dumps_'; 56 return fileName + date; 57 }, 58 }, 59}; 60</script> 61