summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-08-19 16:31:49 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-08-19 16:31:49 +0300
commit6e09dd79705f941a91a4ff094fbddda831492216 (patch)
treef65bdd128a0b39f775638764c2da970f577c89d2
parent016664360d400969178895774cfd896e9e78681c (diff)
downloadwebui-vue-6e09dd79705f941a91a4ff094fbddda831492216.tar.xz
refactor pci store
-rw-r--r--src/locales/ru-RU.json2
-rw-r--r--src/store/modules/HardwareStatus/PciStore.js15
-rw-r--r--src/views/_sila/Overview/Inventory/InventoryPciDevices.vue5
3 files changed, 8 insertions, 14 deletions
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json
index 98c6d6c3..08152b73 100644
--- a/src/locales/ru-RU.json
+++ b/src/locales/ru-RU.json
@@ -1109,7 +1109,7 @@
"table": {
"id": "Идентификатор",
"health": "Состояние",
- "health_d": "Работоспособен",
+ "health_d": "OK",
"name": "Имя",
"type": "Тип устройства",
"class": "Класс устройства",
diff --git a/src/store/modules/HardwareStatus/PciStore.js b/src/store/modules/HardwareStatus/PciStore.js
index e49e452c..538b783f 100644
--- a/src/store/modules/HardwareStatus/PciStore.js
+++ b/src/store/modules/HardwareStatus/PciStore.js
@@ -101,18 +101,15 @@ const PciStore = {
return Promise.allSettled(Members)
.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);
})
+ .then((response) => commit('setFunctionDevices', response))
.catch((error) => console.log(error));
},
- async getFunctionDevices({ commit, state }) {
- const Functions = state.pci
- .map((item) => item.Members)
- .flat(Infinity)
- .map((item) => api.get(item['@odata.id']));
- return Promise.allSettled(Functions).then((response) =>
- commit('setFunctionDevices', response)
- );
- },
},
};
diff --git a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue
index ff1255ce..91e131de 100644
--- a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue
+++ b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue
@@ -130,10 +130,7 @@ export default {
return this.$store
.dispatch('pci/getDevices')
.then(() => {
- return this.$store.dispatch('pci/getDevicesMembers');
- })
- .then(() => {
- this.$store.dispatch('pci/getFunctionDevices');
+ this.$store.dispatch('pci/getDevicesMembers');
})
.finally(() => {
this.$root.$emit('hardware-status-pci-complete');