diff options
Diffstat (limited to 'src/store/modules/HardwareStatus')
-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') + ); + } + }); + }, }, }; |