From 240c056c8989c5e3e0f0ff640f38f3e4cdbc6ac5 Mon Sep 17 00:00:00 2001 From: Sandeepa Singh Date: Thu, 6 May 2021 21:59:20 +0530 Subject: 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 Change-Id: Id2ef82573a4d17059dc9f4929155aa05cabef2aa --- src/store/modules/Health/ChassisStore.js | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/store') 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') + ); + } + }); + }, }, }; -- cgit v1.2.3