summaryrefslogtreecommitdiff
path: root/src/views/_sila/PciDevices/PciDevices.vue
blob: 77f40b6656bdc78f52d5d2eb937ac808b38fc1d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <b-container fluid="xl">
    <page-title />
    <page-section :section-title="$t('pagePci.title')">
      <b-table
        responsive="md"
        show-empty
        hover
        :items="items"
        :fields="fields"
        :empty-text="$t('global.table.emptyMessage')"
        :busy="isBusy"
      >
      </b-table>
    </page-section>
  </b-container>
</template>

<script>
import PageTitle from '@/components/_sila/Global/PageTitle';
import PageSection from '@/components/_sila/Global/PageSection';

import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';

export default {
  components: { PageTitle, PageSection },
  mixins: [DataFormatterMixin, LoadingBarMixin],
  data() {
    return {
      isBusy: true,
      fields: [
        {
          key: 'id',
          label: this.$t('pagePci.table.id'),
          formatter: this.dataFormatter,
          tdClass: 'text-nowrap',
        },
        {
          key: 'name',
          label: this.$t('pagePci.table.name'),
          formatter: this.dataFormatter,
        },
        {
          key: 'type',
          label: this.$t('pagePci.table.type'),
          formatter: this.dataFormatter,
        },
        {
          key: 'manufacturer',
          label: this.$t('pagePci.table.manufacturer'),
          formatter: this.dataFormatter,
        },
        {
          key: 'classCode',
          label: this.$t('pagePci.table.classCode'),
          formatter: this.dataFormatter,
        },
        {
          key: 'deviceClass',
          label: this.$t('pagePci.table.deviceClass'),
          formatter: this.dataFormatter,
        },
      ],
    };
  },

  computed: {
    items() {
      return this.$store.getters['pci/pciDevices'];
    },
  },

  created() {
    this.startLoader();
    this.$store
      .dispatch('pci/getDevices')
      .then(() => {
        this.$store.dispatch('pci/getFunctionDevices');
      })
      .finally(() => {
        this.endLoader();
        this.isBusy = false;
      });
  },
};
</script>