diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-01 10:43:50 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-01 10:43:50 +0300 |
commit | 2fc01c3680c47cd729e73a1f1cb343b5dbe8e7f1 (patch) | |
tree | 11718bc97b901906b5f8ae69ca00a68095650324 /src | |
parent | 53e003b2502a8b01afdd65ff1c3fd2c485419bd5 (diff) | |
parent | b79c36cf0c271313e4ae5f2d223fc25505f202c7 (diff) | |
download | webui-vue-2fc01c3680c47cd729e73a1f1cb343b5dbe8e7f1.tar.xz |
Merge branch 'sila' of git.sila.ru:pub/openbmc/webui-vue into sila
Diffstat (limited to 'src')
-rw-r--r-- | src/store/modules/HardwareStatus/PciStore.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/store/modules/HardwareStatus/PciStore.js b/src/store/modules/HardwareStatus/PciStore.js index 97817d55..dcc7c175 100644 --- a/src/store/modules/HardwareStatus/PciStore.js +++ b/src/store/modules/HardwareStatus/PciStore.js @@ -85,18 +85,22 @@ const PciStore = { async getDevices({ commit }) { return await api .get('/redfish/v1/Systems/system/PCIeDevices') + // get all pci devices .then(({ data: { Members = [] } }) => { const devices = Members.map((item) => async () => api.get(item['@odata.id']) ); + // create an array of async functions to get all devices return devices; }) .then(async (response) => { + // calling functions one by one to avoid errors const results = []; for (let request of response) { const reponse = await request(); results.push(reponse); } + // return successful requests return Promise.allSettled(results); }) .then((response) => { @@ -105,6 +109,7 @@ const PciStore = { .catch((error) => console.log(error)); }, async getDevicesMembers({ commit, state }) { + // the same logic as in getDevices const Members = state.pci.map((item) => async () => api.get(item.PCIeFunction['@odata.id']) ); @@ -117,6 +122,7 @@ const PciStore = { .then((response) => { commit('setPciDevisesMembers', response); const Functions = response + // can return an array of routes .map((item) => item.value.data.Members) .flat(Infinity) .map((item) => async () => api.get(item['@odata.id'])); |