diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-05-13 22:55:48 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-05-16 07:56:28 +0300 |
commit | a3cbc659093a349adb998b36b16fbb382109868f (patch) | |
tree | 6c3b5a267de4816e39debfd11b127d3653598eb2 /src/store/modules | |
parent | b115aea1eab526971983369986e2d2a56e17ff15 (diff) | |
download | webui-vue-a3cbc659093a349adb998b36b16fbb382109868f.tar.xz |
Add Redfish mapping for quiesced and dignostics mode
- Add yellow warning icon Power status in app header for
diagnostics mode
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I8a0f18139da2a29f4bcc4025db3aada158f86026
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/GlobalStore.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 879d8d89..1327422a 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -16,9 +16,11 @@ const hostStateMapper = hostState => { case 'Off': // Redfish PowerState return 'off'; case HOST_STATE.error: - // TODO: Map Redfish Quiesced when bmcweb supports + case 'Quiesced': // Redfish Status return 'error'; - // TODO: Add mapping for DiagnosticMode + case HOST_STATE.diagnosticMode: + case 'InTest': // Redfish Status + return 'diagnosticMode'; default: return 'unreachable'; } @@ -53,8 +55,15 @@ const GlobalStore = { getHostStatus({ commit }) { api .get('/redfish/v1/Systems/system') - .then(({ data: { PowerState } } = {}) => { - commit('setHostStatus', PowerState); + .then(({ data: { PowerState, Status: { State } = {} } } = {}) => { + if (State === 'Quiesced' || State === 'InTest') { + // OpenBMC's host state interface is mapped to 2 Redfish + // properties "Status""State" and "PowerState". Look first + // at State for certain cases. + commit('setHostStatus', State); + } else { + commit('setHostStatus', PowerState); + } }) .catch(error => console.log(error)); } |