summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorSandeepa Singh <sandeepa.singh@ibm.com>2021-05-24 11:21:09 +0300
committerDerick Montague <derick.montague@ibm.com>2021-07-21 15:56:02 +0300
commit06d53863a83c003e7248f5cfc8362765882d19bb (patch)
tree2603dc1b60ac4b59c7ec6a16e43c5ec3b50e2a38 /src/store
parentf65cc7b29a90b71a5e6c888ea180150e232be79e (diff)
downloadwebui-vue-06d53863a83c003e7248f5cfc8362765882d19bb.tar.xz
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 <sandeepa.singh@ibm.com> Change-Id: I26cf1e01bfdfcf298f24f2c7dd9633ab7d31f1b5
Diffstat (limited to 'src/store')
-rw-r--r--src/store/index.js2
-rw-r--r--src/store/modules/Health/PostCodeLogsStore.js39
2 files changed, 41 insertions, 0 deletions
diff --git a/src/store/index.js b/src/store/index.js
index 82efab91..29dfe4fc 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -23,6 +23,7 @@ import FanStore from './modules/Health/FanStore';
import ChassisStore from './modules/Health/ChassisStore';
import BmcStore from './modules/Health/BmcStore';
import ProcessorStore from './modules/Health/ProcessorStore';
+import PostCodeLogsStore from './modules/Health/PostCodeLogsStore';
import SecuritySettingsStore from './modules/Configuration/SecuritySettingsStore';
import FactoryResetStore from './modules/Control/FactoryResetStore';
@@ -60,6 +61,7 @@ export default new Vuex.Store({
chassis: ChassisStore,
bmc: BmcStore,
processors: ProcessorStore,
+ postCodeLogs: PostCodeLogsStore,
virtualMedia: VirtualMediaStore,
securitySettings: SecuritySettingsStore,
factoryReset: FactoryResetStore,
diff --git a/src/store/modules/Health/PostCodeLogsStore.js b/src/store/modules/Health/PostCodeLogsStore.js
new file mode 100644
index 00000000..ac470ece
--- /dev/null
+++ b/src/store/modules/Health/PostCodeLogsStore.js
@@ -0,0 +1,39 @@
+import api from '@/store/api';
+
+const PostCodeLogsStore = {
+ namespaced: true,
+ state: {
+ allPostCodes: [],
+ },
+ getters: {
+ allPostCodes: (state) => 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;