diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js index 4e9c64bce9..c923f5af80 100644 --- a/src/store/modules/HardwareStatus/PowerSupplyStore.js +++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js @@ -13,12 +13,10 @@ const PowerSupplyStore = { setPowerSupply: (state, data) => { state.powerSupplies = data.map((powerSupply) => { const { - EfficiencyRatings, FirmwareVersion, + Location, LocationIndicatorActive, Id, - Location, - Manufacturer, Model, Name, PartNumber, @@ -31,11 +29,9 @@ const PowerSupplyStore = { health: Status.Health, partNumber: PartNumber, serialNumber: SerialNumber, - efficiencyPercent: EfficiencyRatings[0].EfficiencyPercent, firmwareVersion: FirmwareVersion, identifyLed: LocationIndicatorActive, locationNumber: Location?.PartLocation?.ServiceLabel, - manufacturer: Manufacturer, model: Model, name: Name, sparePartNumber: SparePartNumber, @@ -46,25 +42,9 @@ const PowerSupplyStore = { }, }, actions: { - async getChassisCollection() { + async getAllPowerSupplies({ commit }, requestBody) { return await api - .get('/redfish/v1/') - .then((response) => api.get(response.data.Chassis['@odata.id'])) - .then(({ data: { Members } }) => - Members.map((member) => member['@odata.id']) - ) - .catch((error) => console.log(error)); - }, - async getAllPowerSupplies({ dispatch }) { - const collection = await dispatch('getChassisCollection'); - if (!collection) return; - return await api - .all(collection.map((chassis) => dispatch('getPowerSupplies', chassis))) - .catch((error) => console.log(error)); - }, - async getPowerSupplies({ commit }, id) { - return await api - .get(`${id}`) + .get(`${requestBody.uri}`) .then((response) => api.get(response.data.PowerSubsystem['@odata.id'])) .then((response) => api.get(response.data.PowerSupplies['@odata.id'])) .then(({ data: { Members } }) => @@ -89,12 +69,10 @@ const PowerSupplyStore = { return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { console.log(error); if (led.identifyLed) { - throw new Error( - i18n.t('pageHardwareStatus.toast.errorEnableIdentifyLed') - ); + throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed')); } else { throw new Error( - i18n.t('pageHardwareStatus.toast.errorDisableIdentifyLed') + i18n.t('pageInventory.toast.errorDisableIdentifyLed') ); } }); diff --git a/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue b/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue index 316513070c..b1299eb308 100644 --- a/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue +++ b/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue @@ -19,11 +19,11 @@ no-sort-reset hover responsive="md" - sort-by="health" + sort-by="id" show-empty :items="powerSupplies" :fields="fields" - :sort-desc="true" + :sort-desc="false" :sort-compare="sortCompare" :filter="searchFilter" :empty-text="$t('global.table.emptyMessage')" @@ -50,12 +50,20 @@ {{ value }} - + +