diff options
author | SurenNeware <sneware9@in.ibm.com> | 2020-04-01 11:37:27 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-05-20 20:41:11 +0300 |
commit | 090c2d44c47f4f68dd70c4c60b576542d7979836 (patch) | |
tree | 7847747e429eba932f127335ebd573808b14ec4c /src/store/modules | |
parent | 1057b1d7cfd1ac6138dcd77c5f1d514a4d884c5d (diff) | |
download | webui-vue-090c2d44c47f4f68dd70c4c60b576542d7979836.tar.xz |
Add ServerLED page
Added ability to turn on/off Indicator LED.
Signed-off-by: Suren Neware <sneware9@in.ibm.com>
Change-Id: Ia59eb0214530906dea840ff18ff22fc913870bb9
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/Control/ServerLedStore.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/store/modules/Control/ServerLedStore.js b/src/store/modules/Control/ServerLedStore.js new file mode 100644 index 00000000..c690d7cb --- /dev/null +++ b/src/store/modules/Control/ServerLedStore.js @@ -0,0 +1,36 @@ +import api from '../../api'; + +const ServerLedStore = { + namespaced: true, + state: { + indicatorValue: 'Off' + }, + getters: { + getIndicatorValue: state => state.indicatorValue + }, + mutations: { + setIndicatorValue(state, indicatorValue) { + state.indicatorValue = indicatorValue; + } + }, + actions: { + getIndicatorValue: ({ commit }) => { + api + .get('/redfish/v1/Systems/system') + .then(response => { + commit('setIndicatorValue', response.data.IndicatorLED); + }) + .catch(error => console.log(error)); + }, + saveIndicatorLedValue: ({ commit }, payload) => { + api + .patch('/redfish/v1/Systems/system', { IndicatorLED: payload }) + .then(() => { + commit('setIndicatorValue', payload); + }) + .catch(error => console.log(error)); + } + } +}; + +export default ServerLedStore; |