diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-09-02 15:39:37 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-09-02 15:39:37 +0300 |
commit | 23f1872e87fe65f2cea1ebcef3b544421be09e03 (patch) | |
tree | 92cd5adacfc17ab2f8d9438bf6e97fb537ae171e /src/views | |
parent | 3682e47e5cec528bc9ba1e487f1002fa1a6f786e (diff) | |
download | webui-vue-23f1872e87fe65f2cea1ebcef3b544421be09e03.tar.xz |
fix for pci
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/_sila/Overview/Inventory/InventoryPciDevices.vue | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue index 74858649..9e5ec4d4 100644 --- a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue +++ b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue @@ -4,7 +4,7 @@ responsive="md" show-empty hover - :items="items" + :items="pci" :fields="fields" :empty-text="$t('global.table.emptyMessage')" :busy="isBusy" @@ -12,8 +12,8 @@ <template #cell(expandRow)="row"> <b-button v-if=" - items[row.index].DeviceType !== 'SingleFunction' && - items[row.index].Functions + pci[row.index].DeviceType !== 'SingleFunction' && + pci[row.index].Functions " variant="link" :title="expandRowLabel" @@ -24,30 +24,18 @@ <span class="sr-only">{{ expandRowLabel }}</span> </b-button> </template> - <template #cell(DeviceName)="data"> - <span v-if="items[data.index].DeviceType === 'SingleFunction'"> - {{ data.value }}</span - > - <span v-else> - {{ - items[data.index].Functions - ? items[data.index].Functions[0].DeviceName - : '--' - }}</span - > - </template> <template #cell(health)> <status-icon :status="statusIcon('OK')" /> {{ $t('pagePci.table.health_d') }} </template> <template #cell(deviceClass)="data"> - <span v-if="items[data.index].DeviceType === 'SingleFunction'"> + <span v-if="pci[data.index].DeviceType === 'SingleFunction'"> {{ data.value }}</span > <span v-else> {{ - items[data.index].Functions - ? items[data.index].Functions[0].deviceClass + pci[data.index].Functions + ? pci[data.index].Functions[0].deviceClass : '--' }}</span > @@ -81,6 +69,8 @@ </template> <script> +import { mapState } from 'vuex'; + import PageSection from '@/components/_sila/Global/PageSection'; import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; import StatusIcon from '@/components/_sila/Global/StatusIcon'; @@ -136,21 +126,14 @@ export default { }, computed: { - items() { - return this.$store.getters['pci/pciDevices']; - }, + ...mapState('pciStore', ['pci']), }, created() { - return this.$store - .dispatch('pci/getDevices') - .then(() => { - this.$store.dispatch('pci/getDevicesMembers'); - }) - .finally(() => { - this.$root.$emit('hardware-status-pci-complete'); - this.isBusy = false; - }); + return this.$store.dispatch('pciStore/getDevices').finally(() => { + this.$root.$emit('hardware-status-pci-complete'); + this.isBusy = false; + }); }, }; </script> |