diff options
Diffstat (limited to 'src/store/modules')
-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')); |