diff options
author | Nikhil Ashoka <a.nikhil@ibm.com> | 2024-05-09 12:47:44 +0300 |
---|---|---|
committer | Sivaprabu Ganesan <sivaprabug@ami.com> | 2024-05-21 06:04:22 +0300 |
commit | f11a190192115fbb798dc0ded02d3f383e407922 (patch) | |
tree | 32f46e38393e5e6d4a641c379a6ce01437ac3be7 /src/store/modules/HardwareStatus/ProcessorStore.js | |
parent | 07368136b6578638f04f961b3842e93d57e41397 (diff) | |
download | webui-vue-f11a190192115fbb798dc0ded02d3f383e407922.tar.xz |
Added toast notification for identify LEDs
- Added success toast notification messages for identify
LEDs present at Inventory and LEDs page and Overview.
- Import of Toast was not present in Overview's Inventory
card and DIMM slot table, fixed it.
Signed-off-by: Nikhil Ashoka <a.nikhil@ibm.com>
Change-Id: If9ad84e66f6f15616cb8af51b1e84d8d06b1afd0
Diffstat (limited to 'src/store/modules/HardwareStatus/ProcessorStore.js')
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 29fb9989..49f96208 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -81,17 +81,28 @@ const ProcessorStore = { const updatedIdentifyLedValue = { LocationIndicatorActive: led.identifyLed, }; - return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { - dispatch('getProcessorsInfo'); - console.log('error', error); - if (led.identifyLed) { - throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed')); - } else { - throw new Error( - i18n.t('pageInventory.toast.errorDisableIdentifyLed'), - ); - } - }); + return await api + .patch(uri, updatedIdentifyLedValue) + .then(() => { + if (led.identifyLed) { + return i18n.t('pageInventory.toast.successEnableIdentifyLed'); + } else { + return i18n.t('pageInventory.toast.successDisableIdentifyLed'); + } + }) + .catch((error) => { + dispatch('getProcessorsInfo'); + console.log('error', error); + if (led.identifyLed) { + throw new Error( + i18n.t('pageInventory.toast.errorEnableIdentifyLed'), + ); + } else { + throw new Error( + i18n.t('pageInventory.toast.errorDisableIdentifyLed'), + ); + } + }); }, }, }; |