From a3cbc659093a349adb998b36b16fbb382109868f Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Wed, 13 May 2020 12:55:48 -0700 Subject: 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 Change-Id: I8a0f18139da2a29f4bcc4025db3aada158f86026 --- src/components/AppHeader/AppHeader.vue | 2 ++ src/store/modules/GlobalStore.js | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue index 2ad208fc..48a68fc3 100644 --- a/src/components/AppHeader/AppHeader.vue +++ b/src/components/AppHeader/AppHeader.vue @@ -92,6 +92,8 @@ export default { return 'success'; case 'error': return 'danger'; + case 'diagnosticMode': + return 'warning'; case 'off': default: return 'secondary'; 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)); } -- cgit v1.2.3