Fix single event entry download
For event entry download, the href not work since the event entry
download only work with header of "Accept: application/octet-stream" or
the default "*/*", change to click function to make it work.
Refer: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/40136
Change-Id: I11051e913bfd71ef081bed93ffcbeeb1edd8c730
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
diff --git a/src/store/modules/Logs/EventLogStore.js b/src/store/modules/Logs/EventLogStore.js
index e67da39..f302dff 100644
--- a/src/store/modules/Logs/EventLogStore.js
+++ b/src/store/modules/Logs/EventLogStore.js
@@ -220,6 +220,22 @@
throw new Error(i18n.t('pageEventLogs.toast.errorLogStatusUpdate'));
});
},
+ async downloadEntry(_, uri) {
+ return await api
+ .get(uri)
+ .then((response) => {
+ const blob = new Blob([response.data], {
+ type: response.headers['content-type'],
+ });
+ return blob;
+ })
+ .catch((error) => {
+ console.log(error);
+ throw new Error(
+ i18n.t('pageEventLogs.toast.errorDownloadEventEntry'),
+ );
+ });
+ },
},
};