diff options
author | Sandeepa Singh <sandeepa.singh@ibm.com> | 2021-09-27 12:22:38 +0300 |
---|---|---|
committer | Dixsie Wolmers <dixsiew@gmail.com> | 2021-10-28 16:23:16 +0300 |
commit | 8187678816dee0342b46e6f095324097ea734fea (patch) | |
tree | b2c0c9f32799efa6de829d1251b59881441bf2e1 /src/store/modules | |
parent | 15cee709835a9dbf01ba292c5a16f7ffa226f553 (diff) | |
download | webui-vue-8187678816dee0342b46e6f095324097ea734fea.tar.xz |
Add Dimms table missing properties
- Added the following properties: Model, Description, Spare part number,
Location Number, Memory type, Memory size, Identify led
- Design has been updated for Dimms table on inventory page
Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com>
Change-Id: Ife61396bd70c29df1b5ea55091adc8c6813b5cdc
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index cd2478de..6f6abe53 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const MemoryStore = { namespaced: true, @@ -11,13 +12,31 @@ const MemoryStore = { mutations: { setMemoryInfo: (state, data) => { state.dimms = data.map(({ data }) => { - const { Id, Status = {}, PartNumber, SerialNumber } = data; + const { + Id, + Status = {}, + PartNumber, + SerialNumber, + SparePartNumber, + Description, + MemoryType, + MemorySize, + LocationIndicatorActive, + Location, + } = data; return { id: Id, health: Status.Health, partNumber: PartNumber, serialNumber: SerialNumber, statusState: Status.State, + sparePartNumber: SparePartNumber, + description: Description, + memoryType: MemoryType, + memorySize: MemorySize, + identifyLed: LocationIndicatorActive, + uri: data['@odata.id'], + locationNumber: Location?.PartLocation?.ServiceLabel, }; }); }, @@ -33,6 +52,23 @@ const MemoryStore = { .then((response) => commit('setMemoryInfo', response)) .catch((error) => console.log(error)); }, + async updateIdentifyLedValue({ dispatch }, led) { + const uri = led.uri; + const updatedIdentifyLedValue = { + LocationIndicatorActive: led.identifyLed, + }; + return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { + dispatch('getDimms'); + console.log('error', error); + if (led.identifyLed) { + throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed')); + } else { + throw new Error( + i18n.t('pageInventory.toast.errorDisableIdentifyLed') + ); + } + }); + }, }, }; |