From 8047ae3d83ba0718fb7a42907036157e5c680b85 Mon Sep 17 00:00:00 2001
From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU>
Date: Mon, 4 Jul 2022 23:59:32 +0300
Subject: IBS: _sila UI theme

---
 src/views/_sila/Overview/OverviewDumps.vue | 54 ++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 src/views/_sila/Overview/OverviewDumps.vue

(limited to 'src/views/_sila/Overview/OverviewDumps.vue')

diff --git a/src/views/_sila/Overview/OverviewDumps.vue b/src/views/_sila/Overview/OverviewDumps.vue
new file mode 100644
index 00000000..a2ae4e4e
--- /dev/null
+++ b/src/views/_sila/Overview/OverviewDumps.vue
@@ -0,0 +1,54 @@
+<template>
+  <overview-card
+    :data="dumps"
+    :disabled="dumps.length === 0"
+    :download-button="true"
+    :file-name="exportFileNameByDate()"
+    :title="$t('pageOverview.dumps')"
+    :to="`/logs/dumps`"
+  >
+    <b-row class="mt-3">
+      <b-col sm="6">
+        <dl>
+          <dt>{{ $t('pageOverview.total') }}</dt>
+          <dd class="h3">{{ dataFormatter(dumps.length) }}</dd>
+        </dl>
+      </b-col>
+    </b-row>
+  </overview-card>
+</template>
+
+<script>
+import OverviewCard from './OverviewCard';
+import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
+
+export default {
+  name: 'Dumps',
+  components: {
+    OverviewCard,
+  },
+  mixins: [DataFormatterMixin],
+  computed: {
+    dumps() {
+      return this.$store.getters['dumps/allDumps'];
+    },
+  },
+  created() {
+    this.$store.dispatch('dumps/getBmcDumpEntries').finally(() => {
+      this.$root.$emit('overview-dumps-complete');
+    });
+  },
+  methods: {
+    exportFileNameByDate() {
+      // Create export file name based on date
+      let date = new Date();
+      date =
+        date.toISOString().slice(0, 10) +
+        '_' +
+        date.toString().split(':').join('-').split(' ')[4];
+      let fileName = 'all_dumps_';
+      return fileName + date;
+    },
+  },
+};
+</script>
-- 
cgit v1.2.3

