summaryrefslogtreecommitdiff
path: root/src/views/_sila/Processors/Specification/ProcessorsSpecificationTable.vue
blob: c872eefca869a380d9b39fcb18d364c915f94668 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<template>
  <b-table
    sort-icon-left
    no-sort-reset
    :sort-desc="true"
    responsive="md"
    show-empty
    no-border-collapse
    :items="processors"
    :fields="fields"
    :empty-text="$t('global.table.emptyMessage')"
    :empty-filtered-text="$t('global.table.emptySearchMessage')"
  >
    <template #cell(expandRow)="row">
      <b-button
        variant="link"
        data-test-id="hardwareStatus-button-expandProcessors"
        :title="expandRowLabel"
        class="btn-icon-only"
        @click="toggleRowDetails(row)"
      >
        <icon-chevron />
        <span class="sr-only">{{ expandRowLabel }}</span>
      </b-button>
    </template>
    <template #cell(status)="{ value }">
      <div v-if="value" class="fans-table-col-first__cell">
        <img class="status__img" src="@/assets/images/status/on.svg" />
        <span>
          {{ $t('global.status.inWork') }}
        </span>
      </div>
      <div v-else class="fans-table-col-first__cell">
        <img class="status__img" src="@/assets/images/_sila/status/off.svg" />
        <span>
          {{ $t('global.status.outWorking') }}
        </span>
      </div>
    </template>

    <template #row-details="{ index }">
      <b-container fluid>
        <!-- ProcessorCapabilityInfo -->
        <b-row>
          <b-col class="mt-3 mb-2 p-0 bold-12px__caps">
            {{ $t('pageInventory.table.processorCacheInfo') }}
          </b-col>
        </b-row>
        <b-row>
          <b-col class="mt-2 p-0" sm="3" xl="3">
            <dl class="light-12px">
              <!-- Attributes Names -->
              <dd class="attrib-names">{{ $t('global.table.attributes') }}</dd>
              <dd>{{ 'Уровень кеша' }}</dd>
              <dd>{{ 'Максимальный объем' }}</dd>
              <dd>{{ 'Установленный объем' }}</dd>
              <dd>{{ 'Тип кэша' }}</dd>
              <dd>{{ 'Локализация' }}</dd>
              <dd>{{ 'Политика записи' }}</dd>
              <dd>{{ 'Ассоциативность' }}</dd>
              <dd>{{ 'Тип исправления ошибки' }}</dd>
            </dl>
          </b-col>
          <b-col class="mt-2 p-0" sm="3" xl="3">
            <dl class="light-12px">
              <!-- Status КЭШ-1 -->
              <dd class="attrib-names">{{ 'КЭШ-1' }}</dd>
              <dd v-for="item in processors[index].cache_1" :key="item.cache_1">
                {{ dataFormatter(item) }}
              </dd>
            </dl>
          </b-col>
          <b-col class="mt-2 p-0" sm="3" xl="3">
            <dl class="light-12px">
              <!-- Status state -->
              <dd class="attrib-names">{{ 'КЭШ-2' }}</dd>
              <dd v-for="item in processors[index].cache_2" :key="item.cache_2">
                {{ dataFormatter(item) }}
              </dd>
            </dl>
          </b-col>
          <b-col class="mt-2 p-0" sm="3" xl="3">
            <dl class="light-12px">
              <dd class="attrib-names">{{ 'КЭШ-3' }}</dd>
              <dd v-for="item in processors[index].cache_3" :key="item.cache_3">
                {{ dataFormatter(item) }}
              </dd>
            </dl>
          </b-col>
        </b-row>
        <b-row>
          <b-col class="mt-3 mb-2 p-0 bold-12px__caps">
            {{ $t('pageInventory.table.SupportedTechnologies') }}
          </b-col>
        </b-row>
        <b-row>
          <b-col class="mt-2 p-0" sm="6" xl="6">
            <dl class="light-12px">
              <dd class="attrib-names">{{ $t('global.table.attributes') }}</dd>
              <dd></dd>
              <dd>{{ 'processor' }}</dd>
              <dd>{{ 'vendor_id' }}</dd>
              <dd>{{ 'cpu family' }}</dd>
              <dd>{{ 'model' }}</dd>
              <dd>{{ 'model name' }}</dd>
              <dd>{{ 'stepping' }}</dd>
              <dd>{{ 'microcode' }}</dd>
              <dd>{{ 'cpu MHz' }}</dd>
              <dd>{{ 'cache size' }}</dd>
              <dd>{{ 'physical id' }}</dd>
              <dd>{{ 'siblings' }}</dd>
              <dd>{{ 'core id' }}</dd>
              <dd>{{ 'cpu cores' }}</dd>
              <dd>{{ 'apicid' }}</dd>
              <dd>{{ 'initial apicid' }}</dd>
              <dd>{{ 'fpu' }}</dd>
              <dd>{{ 'fpu_exception' }}</dd>
              <dd>{{ 'cpuid level' }}</dd>
              <dd>{{ 'wp' }}</dd>
              <dd>{{ 'flags' }}</dd>
              <dd>{{ 'bugs' }}</dd>
            </dl>
          </b-col>
          <b-col class="mt-2 p-0" sm="6" xl="6">
            <dl class="light-12px">
              <dd class="attrib-names">{{ $t('global.table.value') }}</dd>
              <dd
                v-for="item in processors[index].description"
                :key="item.description"
              >
                {{ dataFormatter(item) }}
              </dd>
            </dl>
          </b-col>
        </b-row>
      </b-container>
    </template>
  </b-table>
</template>

<script>
import TableRowExpandMixin, {
  expandRowLabel,
} from '@/components/Mixins/TableRowExpandMixin';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';

import { processors } from './helpers';
export default {
  components: { IconChevron },
  mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
  data() {
    return {
      isBusy: true,
      isAddersСolon: false,
      processors,
      fields: [
        {
          key: 'expandRow',
          label: '',
          thStyle: { width: '3%' },
          sortable: false,
        },
        {
          key: 'status',
          label: 'Статус',
          formatter: this.dataFormatter,
          thStyle: { width: '17%' },
        },
        {
          key: 'name',
          label: 'Имя',
          formatter: this.dataFormatter,
          thStyle: { width: '15%' },
        },
        {
          key: 'model',
          label: 'Модель',
          formatter: this.dataFormatter,
          thStyle: { width: '12%' },
        },
        {
          key: 'serialNumber',
          label: 'Серийный номер',
          formatter: this.dataFormatter,
          thStyle: { width: '15%' },
        },
        {
          key: 'version',
          label: 'Версия',
          formatter: this.dataFormatter,
          thStyle: { width: '10%' },
        },
        {
          key: 'frequency',
          label: 'Частота',
          formatter: this.dataFormatter,
          thStyle: { width: '10%' },
        },
        {
          key: 'cores',
          label: 'Ядра',
          formatter: this.dataFormatter,
          thStyle: { width: '10%' },
        },
      ],
      expandRowLabel: expandRowLabel,
    };
  },
};
</script>
<style lang="scss" scoped>
.row {
  margin: 0px;
  flex-wrap: nowrap;
}
.fans-table-col-first__cell {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
}

.status__img {
  margin-right: 7px;
}

.bold-16px {
  margin: 24px 0 0 2rem;
}

.bold-12px__caps {
  color: $text-secondary;
}

.attrib-names {
  border-bottom: 1px solid $faint-secondary-primary-10;
  color: $text-secondary !important;
  font-weight: 600;
}

.custom-switch {
  margin: 0;
}

.btn-link {
  width: 30px !important;
  height: 20px !important;
}
</style>