Add download additional data functionality
Adds ability to download event log additional data data by row.
The download attribute is not used to rename the file
because it causes the download to fail in Chrome
(Chromium bug for base64 files).
Signed-off-by: Dixsie Wolmers <dixsie@ibm.com>
Change-Id: I92164adc0a8ccf1bd6ed23cc5891a04fac47685b
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index a98625b..89d1692 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -247,6 +247,7 @@
}
},
"pageEventLogs": {
+ "additionalDataUri": "Download additional data",
"exportFilePrefix": "event_logs_",
"resolve": "Resolve",
"resolved": "Resolved",
diff --git a/src/store/modules/Health/EventLogStore.js b/src/store/modules/Health/EventLogStore.js
index 2b6d5f9..5664e99 100644
--- a/src/store/modules/Health/EventLogStore.js
+++ b/src/store/modules/Health/EventLogStore.js
@@ -52,6 +52,7 @@
Name,
Modified,
Resolved,
+ AdditionalDataURI,
} = log;
return {
id: Id,
@@ -64,6 +65,7 @@
uri: log['@odata.id'],
filterByStatus: Resolved ? 'Resolved' : 'Unresolved',
status: Resolved, //true or false
+ additionalDataUri: AdditionalDataURI,
};
});
commit('setAllEvents', eventLogs);
diff --git a/src/views/Health/EventLogs/EventLogs.vue b/src/views/Health/EventLogs/EventLogs.vue
index 64e2adb..9bc88c1 100644
--- a/src/views/Health/EventLogs/EventLogs.vue
+++ b/src/views/Health/EventLogs/EventLogs.vue
@@ -107,7 +107,7 @@
<template #row-details="{ item }">
<b-container fluid>
<b-row>
- <b-col sm="6" xl="4">
+ <b-col>
<dl>
<!-- Name -->
<dt>{{ $t('pageEventLogs.table.name') }}:</dt>
@@ -119,7 +119,7 @@
<dd>{{ tableFormatter(item.type) }}</dd>
</dl>
</b-col>
- <b-col sm="6" xl="4">
+ <b-col>
<dl>
<!-- Modified date -->
<dt>{{ $t('pageEventLogs.table.modifiedDate') }}:</dt>
@@ -130,6 +130,15 @@
<dd v-else>--</dd>
</dl>
</b-col>
+ <b-col class="text-nowrap">
+ <b-button
+ class="btn btn-secondary float-right"
+ :href="item.additionalDataUri"
+ target="_blank"
+ >
+ <icon-download />{{ $t('pageEventLogs.additionalDataUri') }}
+ </b-button>
+ </b-col>
</b-row>
</b-container>
</template>
@@ -218,6 +227,7 @@
import IconTrashcan from '@carbon/icons-vue/es/trash-can/20';
import IconExport from '@carbon/icons-vue/es/document--export/20';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
+import IconDownload from '@carbon/icons-vue/es/download/20';
import { omit } from 'lodash';
import PageTitle from '@/components/Global/PageTitle';
@@ -257,6 +267,7 @@
IconExport,
IconTrashcan,
IconChevron,
+ IconDownload,
PageTitle,
Search,
StatusIcon,