summaryrefslogtreecommitdiff
path: root/src/views/_sila/BMC/Configuration/BMCConfigurationTable.vue
blob: f7b6d951c5ac9232b81f9489c4e3f8269084c1e2 (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
88
89
90
91
<template>
  <page-section class="bootstrap-table__section">
    <b-table
      responsive="md"
      show-empty
      class="table-rounded"
      no-border-collapse
      :items="items"
      :fields="fields"
      :busy="isBusy"
      :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 {
      isBusy: true,
      isAddersСolon: false,
      fields: [
        {
          key: 'param',
          label: 'Параметр',
          formatter: this.dataFormatter,
          thStyle: { width: '50%' },
        },
        {
          key: 'value',
          label: 'Значение',
          formatter: this.dataFormatter,
        },
      ],
      expandRowLabel: expandRowLabel,
      items: null,
    };
  },
  computed: {
    bmc() {
      return this.$store.getters['bmc/bmc'];
    },
  },
  watch: {
    bmc() {
      this.items = [
        {
          param: 'Время сервера',
          value: this.bmc.dateTime,
        },
        {
          param: 'uuid',
          value: this.bmc.uuid,
        },
        {
          param: 'Версия прошивки',
          value: this.bmc.firmwareVersion,
        },
        {
          param: 'Модель',
          value: this.bmc.model,
        },
        {
          param: 'Описание',
          value: this.bmc.description,
        },
        {
          param: 'Максимальное количество сессий',
          value: this.bmc.graphicalConsoleMaxSessions,
        },
      ];
    },
  },
  created() {
    this.$store.dispatch('bmc/getBmcInfo').finally(() => {
      this.$root.$emit('hardware-status-bmc-manager-complete');
      this.isBusy = false;
    });
  },
};
</script>