Add ability to downlad dump
- Adds download row action in bmc dumps table
- Adds new rowAction download type to support <a> tag with
download attribute
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I97fd70e6a6783d4336ca1a8486cf1cd3062ebb5d
diff --git a/src/env/components/Dumps/Dumps.vue b/src/env/components/Dumps/Dumps.vue
index 3bf5579..8181c5b 100644
--- a/src/env/components/Dumps/Dumps.vue
+++ b/src/env/components/Dumps/Dumps.vue
@@ -91,9 +91,12 @@
:key="index"
:value="action.value"
:title="action.title"
+ :download-location="row.item.data"
+ :export-name="`${row.item.dumpType} ${row.item.id}`"
@click-table-action="onTableRowAction($event, row.item)"
>
<template #icon>
+ <icon-download v-if="action.value === 'download'" />
<icon-delete v-if="action.value === 'delete'" />
</template>
</table-row-action>
@@ -107,6 +110,7 @@
<script>
import IconDelete from '@carbon/icons-vue/es/trash-can/20';
+import IconDownload from '@carbon/icons-vue/es/download/20';
import DumpsForm from './DumpsForm';
import PageSection from '@/components/Global/PageSection';
@@ -133,6 +137,7 @@
components: {
DumpsForm,
IconDelete,
+ IconDownload,
PageSection,
PageTitle,
Search,
@@ -213,6 +218,10 @@
...item,
actions: [
{
+ value: 'download',
+ title: this.$t('global.action.download'),
+ },
+ {
value: 'delete',
title: this.$t('global.action.delete'),
},