From 06d53863a83c003e7248f5cfc8362765882d19bb Mon Sep 17 00:00:00 2001 From: Sandeepa Singh Date: Mon, 24 May 2021 13:51:09 +0530 Subject: Add POST code logs page This page will be included in the Health section of the primary navigation. The user will be able to export and download POST code logs. Signed-off-by: Sandeepa Singh Change-Id: I26cf1e01bfdfcf298f24f2c7dd9633ab7d31f1b5 --- src/components/AppNavigation/AppNavigationMixin.js | 5 + src/components/Global/TableRowAction.vue | 16 + src/env/components/AppNavigation/ibm.js | 5 + src/env/router/ibm.js | 9 + src/locales/en-US.json | 21 ++ src/router/routes.js | 9 + src/store/index.js | 2 + src/store/modules/Health/PostCodeLogsStore.js | 39 +++ src/views/Health/PostCodeLogs/PostCodeLogs.vue | 344 +++++++++++++++++++++ src/views/Health/PostCodeLogs/index.js | 2 + 10 files changed, 452 insertions(+) create mode 100644 src/store/modules/Health/PostCodeLogsStore.js create mode 100644 src/views/Health/PostCodeLogs/PostCodeLogs.vue create mode 100644 src/views/Health/PostCodeLogs/index.js diff --git a/src/components/AppNavigation/AppNavigationMixin.js b/src/components/AppNavigation/AppNavigationMixin.js index 58852197..f9ba0776 100644 --- a/src/components/AppNavigation/AppNavigationMixin.js +++ b/src/components/AppNavigation/AppNavigationMixin.js @@ -38,6 +38,11 @@ const AppNavigationMixin = { label: this.$t('appNavigation.hardwareStatus'), route: '/health/hardware-status', }, + { + id: 'post-code-logs', + label: this.$t('appNavigation.postCodeLogs'), + route: '/health/post-code-logs', + }, { id: 'sensors', label: this.$t('appNavigation.sensors'), diff --git a/src/components/Global/TableRowAction.vue b/src/components/Global/TableRowAction.vue index 9d853bc7..99fa58b3 100644 --- a/src/components/Global/TableRowAction.vue +++ b/src/components/Global/TableRowAction.vue @@ -12,6 +12,18 @@ {{ title }} + + + + {{ $t('global.action.download') }} + + state.allPostCodes, + }, + mutations: { + setAllPostCodes: (state, allPostCodes) => + (state.allPostCodes = allPostCodes), + }, + actions: { + async getPostCodesLogData({ commit }) { + return await api + .get('/redfish/v1/Systems/system/LogServices/PostCodes/Entries') + .then(({ data: { Members = [] } = {} }) => { + const postCodeLogs = Members.map((log) => { + const { Created, MessageArgs, AdditionalDataURI } = log; + return { + date: new Date(Created), + bootCount: MessageArgs[0], + timeStampOffset: MessageArgs[1], + postCode: MessageArgs[2], + uri: AdditionalDataURI, + }; + }); + commit('setAllPostCodes', postCodeLogs); + }) + .catch((error) => { + console.log('POST Codes Log Data:', error); + }); + }, + }, +}; + +export default PostCodeLogsStore; diff --git a/src/views/Health/PostCodeLogs/PostCodeLogs.vue b/src/views/Health/PostCodeLogs/PostCodeLogs.vue new file mode 100644 index 00000000..1154cbff --- /dev/null +++ b/src/views/Health/PostCodeLogs/PostCodeLogs.vue @@ -0,0 +1,344 @@ + + + diff --git a/src/views/Health/PostCodeLogs/index.js b/src/views/Health/PostCodeLogs/index.js new file mode 100644 index 00000000..ab591124 --- /dev/null +++ b/src/views/Health/PostCodeLogs/index.js @@ -0,0 +1,2 @@ +import PostCodeLogs from './PostCodeLogs.vue'; +export default PostCodeLogs; -- cgit v1.2.3