diff options
author | Sandeepa Singh <sandeepa.singh@ibm.com> | 2021-05-06 19:29:20 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-07-01 19:40:49 +0300 |
commit | 240c056c8989c5e3e0f0ff640f38f3e4cdbc6ac5 (patch) | |
tree | 5fabe5ede8ec55dfe5557a56d76a365ef0a16c84 /src/store/modules/Health | |
parent | 78b6b53d5248d9dc0293af8190c6a69fbaf2ccb0 (diff) | |
download | webui-vue-240c056c8989c5e3e0f0ff640f38f3e4cdbc6ac5.tar.xz |
Add chassis table missing properties
- Added the following properties: Name, Location number, Identify led,
Manufacturer, Chassis type, Asset tag, Max power watts, Min power watts
- Design has been updated for chassis table
Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com>
Change-Id: Id2ef82573a4d17059dc9f4929155aa05cabef2aa
Diffstat (limited to 'src/store/modules/Health')
-rw-r--r-- | src/store/modules/Health/ChassisStore.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/store/modules/Health/ChassisStore.js b/src/store/modules/Health/ChassisStore.js index 251279e6..2faddfbf 100644 --- a/src/store/modules/Health/ChassisStore.js +++ b/src/store/modules/Health/ChassisStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const ChassisStore = { namespaced: true, @@ -19,6 +20,11 @@ const ChassisStore = { ChassisType, Manufacturer, PowerState, + LocationIndicatorActive, + AssetTag, + MaxPowerWatts, + MinPowerWatts, + Name, } = chassis; return { @@ -31,6 +37,12 @@ const ChassisStore = { powerState: PowerState, statusState: Status.State, healthRollup: Status.HealthRollup, + assetTag: AssetTag, + maxPowerWatts: MaxPowerWatts, + minPowerWatts: MinPowerWatts, + name: Name, + identifyLed: LocationIndicatorActive, + uri: chassis['@odata.id'], }; }); }, @@ -49,6 +61,28 @@ const ChassisStore = { }) .catch((error) => console.log(error)); }, + async updateIdentifyLedValue({ dispatch }, led) { + const uri = led.uri; + const updatedIdentifyLedValue = { + LocationIndicatorActive: led.identifyLed, + }; + return await api + .patch(uri, updatedIdentifyLedValue) + .then(() => dispatch('getChassisInfo')) + .catch((error) => { + dispatch('getChassisInfo'); + console.log('error', error); + if (led.identifyLed) { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorEnableIdentifyLed') + ); + } else { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorDisableIdentifyLed') + ); + } + }); + }, }, }; |