diff options
author | Dixsie Wolmers <dixsie@ibm.com> | 2021-06-14 19:29:44 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-07-22 17:27:26 +0300 |
commit | 8b1beffd683a400eec8454ac155f84f0ebcd3f3f (patch) | |
tree | 57ffc45bc7189ac03b85277b6e2aa11f53750fe7 | |
parent | cad5bb9cfc7cc4ce2024b7b227affb3c7a717f1f (diff) | |
download | webui-vue-8b1beffd683a400eec8454ac155f84f0ebcd3f3f.tar.xz |
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
-rw-r--r-- | src/locales/en-US.json | 1 | ||||
-rw-r--r-- | src/store/modules/Health/EventLogStore.js | 2 | ||||
-rw-r--r-- | src/views/Health/EventLogs/EventLogs.vue | 15 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json index a98625bc..89d16928 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 2b6d5f94..5664e99f 100644 --- a/src/store/modules/Health/EventLogStore.js +++ b/src/store/modules/Health/EventLogStore.js @@ -52,6 +52,7 @@ const EventLogStore = { Name, Modified, Resolved, + AdditionalDataURI, } = log; return { id: Id, @@ -64,6 +65,7 @@ const EventLogStore = { 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 64e2adb9..9bc88c1a 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 @@ export default { IconExport, IconTrashcan, IconChevron, + IconDownload, PageTitle, Search, StatusIcon, |