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
diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue
index 2ad208f..48a68fc 100644
--- a/src/components/AppHeader/AppHeader.vue
+++ b/src/components/AppHeader/AppHeader.vue
@@ -92,6 +92,8 @@
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 879d8d8..1327422 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -16,9 +16,11 @@
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 @@
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));
}