From 8187678816dee0342b46e6f095324097ea734fea Mon Sep 17 00:00:00 2001 From: Sandeepa Singh Date: Mon, 27 Sep 2021 14:52:38 +0530 Subject: 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 Change-Id: Ife61396bd70c29df1b5ea55091adc8c6813b5cdc --- src/locales/en-US.json | 6 +- src/store/modules/HardwareStatus/MemoryStore.js | 38 ++++++++++- .../Inventory/InventoryTableDimmSlot.vue | 77 ++++++++++++++++++---- 3 files changed, 106 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 5c457d68..35e71466 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -403,11 +403,13 @@ "manufacturer": "Manufacturer", "maxConcurrentSessions": "Max concurrent sessions", "maxSpeedMHz": "Max speed MHz", - "minSpeedMHz": "Min speed MHz", "maxPowerWatts": "Max power watts", + "memoryType": "Memory type", + "memorySize": "Memory size", + "memorySummary": "Memory summary", "minPowerWatts": "Min power watts", + "minSpeedMHz": "Min speed MHz", "model": "Model", - "memorySummary": "Memory summary", "name": "Name", "partNumber": "Part number", "power": "Power", 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') + ); + } + }); + }, }, }; diff --git a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue index 5d8db83c..07f42d26 100644 --- a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue +++ b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue @@ -49,13 +49,63 @@ {{ value }} - + +