summaryrefslogtreecommitdiff
path: root/src/views/SystemDescription/Info/InventoryTableSystem.vue
blob: f903a46be1d8e9f236241fcf61895a3d1bdeb13b (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
<template>
  <page-section class="bootstrap-table__section">
    <b-table
      responsive="md"
      show-empty
      class="bootstrap-rounded-table"
      :items="systems"
      :fields="fields"
      :empty-text="$t('global.table.emptyMessage')"
    >
    </b-table>
  </page-section>
</template>

<script>
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import PageSection from '@/components/Global/PageSection';

import TableRowExpandMixin, {
  expandRowLabel,
} from '@/components/Mixins/TableRowExpandMixin';

export default {
  components: { PageSection },
  mixins: [BVToastMixin, TableRowExpandMixin],
  data() {
    return {
      fields: [
        {
          key: 'param',
          label: 'Параметр',
          formatter: this.dataFormatter,
          thClass: 'semi-bold-12px__caps bootstrap-rounded-table__head_bg',
          class: `bootstrap-rounded-table__column-first
            bootstrap-rounded-table__column-first___system-table`,
          tdClass: 'regular-12px bootstrap-rounded-table__td',
        },
        {
          key: 'value',
          label: 'Значение',
          formatter: this.dataFormatter,
          thClass: 'semi-bold-12px__caps bootstrap-rounded-table__head_bg',
          class: 'bootstrap-rounded-table__column-last',
          tdClass: 'regular-12px bootstrap-rounded-table__td',
        },
      ],
      expandRowLabel: expandRowLabel,
      systems: [
        {
          param: 'UUID сервера',
          value: '17583',
        },
        { param: 'Модель', value: '1.214.248 beta' },
        { param: 'Производитель', value: 'Asus' },
        { param: 'Операционная система', value: 'Linux' },
        { param: 'Серийный номер', value: '741852963335' },
        {
          param: 'Свободное место на Flash-накопителе',
          value: '1 024 000 Мб',
        },
      ],
    };
  },
  created() {
    this.$store.dispatch('system/getSystem').finally(() => {
      // Emit initial data fetch complete to parent component
      this.$root.$emit('hardware-status-system-complete');
      this.isBusy = false;
    });
  },
  methods: {
    toggleIdentifyLedSwitch(state) {
      this.$store
        .dispatch('system/changeIdentifyLedState', state)
        .catch(({ message }) => this.errorToast(message));
    },
  },
};
</script>
<style lang="scss">
.bootstrap-rounded-table__column-first___system-table {
  width: 50%;
}
</style>