summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSurenNeware <sneware9@in.ibm.com>2020-11-24 14:02:14 +0300
committerDerick Montague <derick.montague@ibm.com>2020-12-01 02:54:01 +0300
commit2aac4d331c88a5b8b1e51749fc00a2a5d1ee3751 (patch)
treee70fd90f98dd57f413b59119cc6441ae6fae0c7b /src
parent842b5dbe74c06fcf75297be7f496d5f9f17655b9 (diff)
downloadwebui-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')
-rw-r--r--src/store/modules/Control/ServerLedStore.js12
-rw-r--r--src/views/Control/ServerLed/ServerLed.vue10
-rw-r--r--src/views/Overview/OverviewQuickLinks.vue4
3 files changed, 12 insertions, 14 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'));
diff --git a/src/views/Control/ServerLed/ServerLed.vue b/src/views/Control/ServerLed/ServerLed.vue
index 73ec704f..6ec62302 100644
--- a/src/views/Control/ServerLed/ServerLed.vue
+++ b/src/views/Control/ServerLed/ServerLed.vue
@@ -9,12 +9,10 @@
v-model="indicatorLed"
data-test-id="serverLed-checkbox-switchIndicatorLed"
name="check-button"
- value="Lit"
- unchecked-value="Off"
switch
@change="changeLedValue"
>
- <span v-if="indicatorLed && indicatorLed !== 'Off'">
+ <span v-if="indicatorLed">
{{ $t('global.status.on') }}
</span>
<span v-else>
@@ -65,10 +63,10 @@ export default {
.then((message) => this.successToast(message))
.catch(({ message }) => {
this.errorToast(message);
- if (indicatorLed === 'Off') {
- this.indicatorLed === 'Lit';
+ if (!indicatorLed) {
+ this.indicatorLed === true;
} else {
- this.indicatorLed === 'Off';
+ this.indicatorLed === false;
}
});
},
diff --git a/src/views/Overview/OverviewQuickLinks.vue b/src/views/Overview/OverviewQuickLinks.vue
index 1330ca5e..207478ac 100644
--- a/src/views/Overview/OverviewQuickLinks.vue
+++ b/src/views/Overview/OverviewQuickLinks.vue
@@ -18,11 +18,9 @@
data-test-id="overviewQuickLinks-checkbox-serverLed"
name="check-button"
switch
- value="Lit"
- unchecked-value="Off"
@change="onChangeServerLed"
>
- <span v-if="serverLedChecked !== 'Off'">
+ <span v-if="serverLedChecked">
{{ $t('global.status.on') }}
</span>
<span v-else>{{ $t('global.status.off') }}</span>