Update indicator LED switch using another property
- Update indicator LED redfish endpoint based on 'LocationIndicatorActive' property.
- Updated both ServerLED and Overview page.
Signed-off-by: Suren Neware <sneware9@in.ibm.com>
Change-Id: Id47133e4834b658d49911be87d93f7985519a6d2
diff --git a/src/store/modules/Control/ServerLedStore.js b/src/store/modules/Control/ServerLedStore.js
index 51e0920..26a32cc 100644
--- a/src/store/modules/Control/ServerLedStore.js
+++ b/src/store/modules/Control/ServerLedStore.js
@@ -4,7 +4,7 @@
const ServerLedStore = {
namespaced: true,
state: {
- indicatorValue: 'Off',
+ indicatorValue: false,
},
getters: {
getIndicatorValue: (state) => state.indicatorValue,
@@ -19,16 +19,18 @@
return await api
.get('/redfish/v1/Systems/system')
.then((response) => {
- commit('setIndicatorValue', response.data.IndicatorLED);
+ commit('setIndicatorValue', response.data.LocationIndicatorActive);
})
.catch((error) => console.log(error));
},
async saveIndicatorLedValue({ commit }, payload) {
return await api
- .patch('/redfish/v1/Systems/system', { IndicatorLED: payload })
+ .patch('/redfish/v1/Systems/system', {
+ LocationIndicatorActive: payload,
+ })
.then(() => {
commit('setIndicatorValue', payload);
- if (payload === 'Lit') {
+ if (payload) {
return i18n.t('pageServerLed.toast.successServerLedOn');
} else {
return i18n.t('pageServerLed.toast.successServerLedOff');
@@ -36,7 +38,7 @@
})
.catch((error) => {
console.log(error);
- if (payload === 'Lit') {
+ if (payload) {
throw new Error(i18n.t('pageServerLed.toast.errorServerLedOn'));
} else {
throw new Error(i18n.t('pageServerLed.toast.errorServerLedOff'));