diff options
author | SurenNeware <sneware9@in.ibm.com> | 2020-11-24 14:02:14 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-12-01 02:54:01 +0300 |
commit | 2aac4d331c88a5b8b1e51749fc00a2a5d1ee3751 (patch) | |
tree | e70fd90f98dd57f413b59119cc6441ae6fae0c7b /src/store/modules/Control | |
parent | 842b5dbe74c06fcf75297be7f496d5f9f17655b9 (diff) | |
download | webui-vue-2aac4d331c88a5b8b1e51749fc00a2a5d1ee3751.tar.xz |
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
Diffstat (limited to 'src/store/modules/Control')
-rw-r--r-- | src/store/modules/Control/ServerLedStore.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/store/modules/Control/ServerLedStore.js b/src/store/modules/Control/ServerLedStore.js index 51e09206..26a32ccb 100644 --- a/src/store/modules/Control/ServerLedStore.js +++ b/src/store/modules/Control/ServerLedStore.js @@ -4,7 +4,7 @@ import i18n from '@/i18n'; const ServerLedStore = { namespaced: true, state: { - indicatorValue: 'Off', + indicatorValue: false, }, getters: { getIndicatorValue: (state) => state.indicatorValue, @@ -19,16 +19,18 @@ const ServerLedStore = { 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 @@ const ServerLedStore = { }) .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')); |