summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-31 16:22:16 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-31 16:22:16 +0300
commitdfc9ebca8098af82994ca6fc8067cc4f8fad5e18 (patch)
tree0c993a9beb818d15827249fe70e799c33293db4b /src/store/modules
parent5cb3ede0b4f441c2ca6e3647bb08dee3d4286603 (diff)
parent04968d5f170d40d7f87784dd0191358844885679 (diff)
downloadwebui-vue-dfc9ebca8098af82994ca6fc8067cc4f8fad5e18.tar.xz
Merge branch 'sila' of git.sila.ru:pub/openbmc/webui-vue into sila
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/HardwareStatus/PciStore.js35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/store/modules/HardwareStatus/PciStore.js b/src/store/modules/HardwareStatus/PciStore.js
index 538b783f..97817d55 100644
--- a/src/store/modules/HardwareStatus/PciStore.js
+++ b/src/store/modules/HardwareStatus/PciStore.js
@@ -86,8 +86,18 @@ const PciStore = {
return await api
.get('/redfish/v1/Systems/system/PCIeDevices')
.then(({ data: { Members = [] } }) => {
- const devices = Members.map((item) => api.get(item['@odata.id']));
- return Promise.allSettled(devices);
+ const devices = Members.map((item) => async () =>
+ api.get(item['@odata.id'])
+ );
+ return devices;
+ })
+ .then(async (response) => {
+ const results = [];
+ for (let request of response) {
+ const reponse = await request();
+ results.push(reponse);
+ }
+ return Promise.allSettled(results);
})
.then((response) => {
commit('setPciDevises', response);
@@ -95,17 +105,30 @@ const PciStore = {
.catch((error) => console.log(error));
},
async getDevicesMembers({ commit, state }) {
- const Members = state.pci.map((item) =>
+ const Members = state.pci.map((item) => async () =>
api.get(item.PCIeFunction['@odata.id'])
);
- return Promise.allSettled(Members)
+ const results = [];
+ for (let request of Members) {
+ const reponse = await request();
+ results.push(reponse);
+ }
+ return Promise.allSettled(results)
.then((response) => {
commit('setPciDevisesMembers', response);
const Functions = response
.map((item) => item.value.data.Members)
.flat(Infinity)
- .map((item) => api.get(item['@odata.id']));
- return Promise.allSettled(Functions);
+ .map((item) => async () => api.get(item['@odata.id']));
+ return Functions;
+ })
+ .then(async (response) => {
+ const results = [];
+ for (let request of response) {
+ const reponse = await request();
+ results.push(reponse);
+ }
+ return Promise.allSettled(results);
})
.then((response) => commit('setFunctionDevices', response))
.catch((error) => console.log(error));