summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSurenNeware <sneware9@in.ibm.com>2020-09-08 15:12:39 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2020-09-16 17:37:47 +0300
commit96ebb0d91eea9ed9d0614663eca8644e86fcbc6b (patch)
tree986c00a35ab00fa7236e822a58caaa91c40c0918 /src
parent1d2da29ea75951ee3f1ae08a25f9c5241eb89ad0 (diff)
downloadwebui-vue-96ebb0d91eea9ed9d0614663eca8644e86fcbc6b.tar.xz
Update name of file of exported log files
- The name of exported event log file would be combination of event logs prefix and current date and time. Signed-off-by: Suren Neware <sneware9@in.ibm.com> Change-Id: Iaaf46fed5df1942e9cc2e4157dafa8e3e755ecf8
Diffstat (limited to 'src')
-rw-r--r--src/locales/en-US.json1
-rw-r--r--src/views/Health/EventLogs/EventLogs.vue17
2 files changed, 16 insertions, 2 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index 2d69a7b0..85e2a3aa 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -161,6 +161,7 @@
}
},
"pageEventLogs": {
+ "exportFilePrefix": "event_logs_",
"modal": {
"deleteTitle": "Delete log | Delete logs",
"deleteMessage": "Are you sure you want to delete %{count} log? This action cannot be undone. | Are you sure you want to delete %{count} logs? This action cannot be undone."
diff --git a/src/views/Health/EventLogs/EventLogs.vue b/src/views/Health/EventLogs/EventLogs.vue
index 0e8a5448..dcede596 100644
--- a/src/views/Health/EventLogs/EventLogs.vue
+++ b/src/views/Health/EventLogs/EventLogs.vue
@@ -34,7 +34,7 @@
<template v-slot:export>
<table-toolbar-export
:data="batchExportData"
- :file-name="$t('appPageTitle.eventLogs')"
+ :file-name="exportFileNameByDate()"
/>
</template>
</table-toolbar>
@@ -96,7 +96,7 @@
:value="action.value"
:title="action.title"
:row-data="row.item"
- :export-name="row.item.id"
+ :export-name="exportFileNameByDate()"
:data-test-id="`eventLogs-button-deleteRow-${row.index}`"
@click:tableAction="onTableRowAction($event, row.item)"
>
@@ -345,6 +345,19 @@ export default {
},
onChangeSearchInput(searchValue) {
this.searchFilter = searchValue;
+ },
+ // Create export file name based on date
+ exportFileNameByDate() {
+ let date = new Date();
+ date =
+ date.toISOString().slice(0, 10) +
+ '_' +
+ date
+ .toString()
+ .split(':')
+ .join('-')
+ .split(' ')[4];
+ return this.$t('pageEventLogs.exportFilePrefix') + date;
}
}
};