summaryrefslogtreecommitdiff
path: root/src/store/modules/GlobalStore.js
diff options
context:
space:
mode:
authorSukanya Pandey <sukapan1@in.ibm.com>2021-08-16 16:29:14 +0300
committerDerick Montague <derick.montague@ibm.com>2021-08-27 04:32:14 +0300
commit4dd7eabfa4476e264e051dc0178a333452a6b175 (patch)
treed4105892c1889155492aeb9dab63411f68a45eaa /src/store/modules/GlobalStore.js
parentd95ea513df003b97a23d58006480508339489fca (diff)
downloadwebui-vue-4dd7eabfa4476e264e051dc0178a333452a6b175.tar.xz
Add system information on Appheader page
- Model type and serial number are newly added system info data on Appheader. - On small screens and below system information(model type, serial number and asset tag) will be hidden. - On large screen and below model type and serial number will be visible but asset tag will be hidden. - For all other screens all the system info will be visible. Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Ia844a26f658083cbd5fa9c8f3f6bea8b65ddcd11
Diffstat (limited to 'src/store/modules/GlobalStore.js')
-rw-r--r--src/store/modules/GlobalStore.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
index fdfdc93f..95d7a083 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -31,6 +31,8 @@ const GlobalStore = {
state: {
assetTag: null,
bmcTime: null,
+ modelType: null,
+ serialNumber: null,
serverStatus: 'unreachable',
languagePreference: localStorage.getItem('storedLanguage') || 'en-US',
isUtcDisplay: localStorage.getItem('storedUtcDisplay')
@@ -41,6 +43,8 @@ const GlobalStore = {
},
getters: {
assetTag: (state) => state.assetTag,
+ modelType: (state) => state.modelType,
+ serialNumber: (state) => state.serialNumber,
serverStatus: (state) => state.serverStatus,
bmcTime: (state) => state.bmcTime,
languagePreference: (state) => state.languagePreference,
@@ -50,6 +54,9 @@ const GlobalStore = {
},
mutations: {
setAssetTag: (state, assetTag) => (state.assetTag = assetTag),
+ setModelType: (state, modelType) => (state.modelType = modelType),
+ setSerialNumber: (state, serialNumber) =>
+ (state.serialNumber = serialNumber),
setBmcTime: (state, bmcTime) => (state.bmcTime = bmcTime),
setServerStatus: (state, serverState) =>
(state.serverStatus = serverStateMapper(serverState)),
@@ -75,12 +82,22 @@ const GlobalStore = {
})
.catch((error) => console.log(error));
},
- getServerStatus({ commit }) {
+ getSystemInfo({ commit }) {
api
.get('/redfish/v1/Systems/system')
.then(
- ({ data: { AssetTag, PowerState, Status: { State } = {} } } = {}) => {
+ ({
+ data: {
+ AssetTag,
+ Model,
+ PowerState,
+ SerialNumber,
+ Status: { State } = {},
+ },
+ } = {}) => {
commit('setAssetTag', AssetTag);
+ commit('setSerialNumber', SerialNumber);
+ commit('setModelType', Model);
if (State === 'Quiesced' || State === 'InTest') {
// OpenBMC's host state interface is mapped to 2 Redfish
// properties "Status""State" and "PowerState". Look first