blob: a2ae4e4ea4d97d98a36af5652a985f441cff7bff [file] [log] [blame]
Dixsie Wolmers6a192d52021-09-02 15:26:58 -05001<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>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050014 <dd class="h3">{{ dataFormatter(dumps.length) }}</dd>
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050015 </dl>
16 </b-col>
17 </b-row>
18 </overview-card>
19</template>
20
21<script>
22import OverviewCard from './OverviewCard';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050023import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050024
25export default {
26 name: 'Dumps',
27 components: {
28 OverviewCard,
29 },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050030 mixins: [DataFormatterMixin],
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050031 computed: {
32 dumps() {
Kennethc2c53aa2021-11-30 17:04:58 -060033 return this.$store.getters['dumps/allDumps'];
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050034 },
35 },
36 created() {
Kennethc2c53aa2021-11-30 17:04:58 -060037 this.$store.dispatch('dumps/getBmcDumpEntries').finally(() => {
Dixsie Wolmers6a192d52021-09-02 15:26:58 -050038 this.$root.$emit('overview-dumps-complete');
39 });
40 },
41 methods: {
42 exportFileNameByDate() {
43 // Create export file name based on date
44 let date = new Date();
45 date =
46 date.toISOString().slice(0, 10) +
47 '_' +
48 date.toString().split(':').join('-').split(' ')[4];
49 let fileName = 'all_dumps_';
50 return fileName + date;
51 },
52 },
53};
54</script>