diff options
author | Konstantin Aladyshev <aladyshev22@gmail.com> | 2023-02-15 15:49:11 +0300 |
---|---|---|
committer | Sandeepa Singh <sandeepa.singh@ibm.com> | 2023-02-21 14:38:29 +0300 |
commit | d8c71c00c2e98703b6e33ca1f9c87966dfb21805 (patch) | |
tree | d614e67e0c594d0830abbd08f2d9793fea26aee7 /src/store/modules | |
parent | b89eed27d5b1bc60a46ce88ab1322e12137425b2 (diff) | |
download | webui-vue-d8c71c00c2e98703b6e33ca1f9c87966dfb21805.tar.xz |
Add button to clear POST code logs
Utilize '#LogService.ClearLog' action to provide a possibility for the
user to clear POST code logs.
Change-Id: Iadd94b9ebc93bc81b13ee979962103587c939fc7
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/Logs/PostCodeLogsStore.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/store/modules/Logs/PostCodeLogsStore.js b/src/store/modules/Logs/PostCodeLogsStore.js index ac470ece..836f9844 100644 --- a/src/store/modules/Logs/PostCodeLogsStore.js +++ b/src/store/modules/Logs/PostCodeLogsStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const PostCodeLogsStore = { namespaced: true, @@ -33,6 +34,22 @@ const PostCodeLogsStore = { console.log('POST Codes Log Data:', error); }); }, + async deleteAllPostCodeLogs({ dispatch }, data) { + return await api + .post( + '/redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog' + ) + .then(() => dispatch('getPostCodesLogData')) + .then(() => + i18n.tc('pagePostCodeLogs.toast.successDelete', data.length) + ) + .catch((error) => { + console.log(error); + throw new Error( + i18n.tc('pagePostCodeLogs.toast.errorDelete', data.length) + ); + }); + }, }, }; |