From ebb64e0052f55ccdb403c4484f9a3a365ffd283f Mon Sep 17 00:00:00 2001
From: Vitalii Lysak <v.lysak@dunice.net>
Date: Tue, 9 Aug 2022 12:40:12 +0300
Subject: SILABMC-226: event additional data

---
 src/views/_sila/Logs/EventLogs/EventLogs.vue | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'src/views/_sila/Logs/EventLogs/EventLogs.vue')

diff --git a/src/views/_sila/Logs/EventLogs/EventLogs.vue b/src/views/_sila/Logs/EventLogs/EventLogs.vue
index 6fe7bc5d..8cc65bfb 100644
--- a/src/views/_sila/Logs/EventLogs/EventLogs.vue
+++ b/src/views/_sila/Logs/EventLogs/EventLogs.vue
@@ -158,8 +158,7 @@
                 <b-col class="text-nowrap">
                   <b-button
                     class="btn btn-secondary float-right"
-                    :href="item.additionalDataUri"
-                    target="_blank"
+                    @click="loadAdditionalData(item.additionalDataUri)"
                   >
                     <icon-download />{{ $t('pageEventLogs.additionalDataUri') }}
                   </b-button>
@@ -466,6 +465,17 @@ export default {
     });
   },
   methods: {
+    loadAdditionalData(url) {
+      this.startLoader();
+      this.$store
+        .dispatch('eventLog/getAdditionalData', url)
+        .catch(() =>
+          this.errorToast(
+            this.$t('pageEventLogs.toast.errorLoadAdditionalData')
+          )
+        )
+        .finally(() => this.endLoader());
+    },
     onSearchBy(field) {
       this.filterIncludedFields = field === 'all' ? null : [field];
     },
-- 
cgit v1.2.3

