blob: a5f57112ad60a470c85c6384a6613033b9f8a6b4 [file] [log] [blame]
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -07001<template>
2 <page-section :section-title="$t('pageHardwareStatus.bmcManager')">
SurenNeware307382e2020-07-27 20:45:14 +05303 <b-table
4 responsive="md"
5 :items="items"
6 :fields="fields"
7 show-empty
8 :empty-text="$t('global.table.emptyMessage')"
9 >
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070010 <!-- Expand chevron icon -->
11 <template v-slot:cell(expandRow)="row">
Dixsie Wolmers83133762020-07-15 08:45:19 -050012 <b-button
13 variant="link"
14 data-test-id="hardwareStatus-button-expandBmc"
15 @click="row.toggleDetails"
16 >
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070017 <icon-chevron />
18 </b-button>
19 </template>
20
21 <!-- Health -->
22 <template v-slot:cell(health)="{ value }">
23 <status-icon :status="statusIcon(value)" />
24 {{ value }}
25 </template>
26
27 <template v-slot:row-details="{ item }">
28 <b-container fluid>
29 <b-row>
30 <b-col sm="6">
31 <dl>
32 <!-- Description -->
33 <dt class="d-block">
34 {{ $t('pageHardwareStatus.table.description') }}:
35 </dt>
36 <dd class="mb-4">
37 {{ tableFormatter(item.description) }}
38 </dd>
39 <br />
40 <!-- Firmware version -->
41 <dt class="d-block">
42 {{ $t('pageHardwareStatus.table.firmwareVersion') }}:
43 </dt>
44 <dd class="mb-4">
45 {{ tableFormatter(item.firmwareVersion) }}
46 </dd>
47 <br />
48 <!-- Service entry point UUID -->
49 <dt class="d-block">
50 {{ $t('pageHardwareStatus.table.serviceEntryPointUuid') }}:
51 </dt>
52 <dd class="mb-4">
53 {{ tableFormatter(item.serviceEntryPointUuid) }}
54 </dd>
55 <br />
56 <!-- UUID -->
57 <dt class="d-block">
58 {{ $t('pageHardwareStatus.table.uuid') }}:
59 </dt>
60 <dd class="mb-4">
61 {{ tableFormatter(item.uuid) }}
62 </dd>
63 </dl>
64 </b-col>
65 <b-col sm="6">
66 <dl>
67 <!-- Power state -->
68 <dt>{{ $t('pageHardwareStatus.table.powerState') }}:</dt>
69 <dd>{{ tableFormatter(item.powerState) }}</dd>
70 <br />
71
72 <!-- Model -->
73 <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt>
74 <dd>{{ tableFormatter(item.model) }}</dd>
75 <br />
76
77 <!-- Health rollup -->
78 <dt>
79 {{ $t('pageHardwareStatus.table.statusHealthRollup') }}:
80 </dt>
81 <dd>{{ tableFormatter(item.healthRollup) }}</dd>
82 <br />
83
84 <!-- Status state -->
85 <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt>
86 <dd>{{ tableFormatter(item.statusState) }}</dd>
87 <br />
88
89 <!-- Graphical console -->
90 <dt class="font-weight-bold mt-3 mb-2 d-block">
91 {{ $t('pageHardwareStatus.table.graphicalConsole') }}
92 </dt>
93 <dt>
94 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
95 </dt>
96 <dd>
97 {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }}
98 </dd>
99 <br />
100 <dt>
101 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
102 </dt>
103 <dd>{{ tableFormatter(item.graphicalConsoleMaxSessions) }}</dd>
104 <br />
105 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
106 <dd>{{ tableFormatter(item.graphicalConsoleEnabled) }}</dd>
107 <br />
108
109 <!-- Serial console -->
110 <dt class="font-weight-bold mt-3 mb-2 d-block">
111 {{ $t('pageHardwareStatus.table.serialConsole') }}
112 </dt>
113 <dt>
114 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
115 </dt>
116 <dd>
117 {{ tableFormatterArray(item.serialConsoleConnectTypes) }}
118 </dd>
119 <br />
120 <dt>
121 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
122 </dt>
123 <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd>
124 <br />
125 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
126 <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd>
127 </dl>
128 </b-col>
129 </b-row>
130 </b-container>
131 </template>
132 </b-table>
133 </page-section>
134</template>
135
136<script>
137import PageSection from '@/components/Global/PageSection';
138import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
139
140import StatusIcon from '@/components/Global/StatusIcon';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700141import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700142
143export default {
144 components: { IconChevron, PageSection, StatusIcon },
Yoshie Muranaka386df452020-06-18 12:45:13 -0700145 mixins: [TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700146 data() {
147 return {
148 fields: [
149 {
150 key: 'expandRow',
151 label: '',
152 tdClass: 'table-row-expand'
153 },
154 {
155 key: 'id',
156 label: this.$t('pageHardwareStatus.table.id'),
157 formatter: this.tableFormatter
158 },
159 {
160 key: 'health',
161 label: this.$t('pageHardwareStatus.table.health'),
162 formatter: this.tableFormatter
163 },
164 {
165 key: 'partNumber',
166 label: this.$t('pageHardwareStatus.table.partNumber'),
167 formatter: this.tableFormatter
168 },
169 {
170 key: 'serialNumber',
171 label: this.$t('pageHardwareStatus.table.serialNumber'),
172 formatter: this.tableFormatter
173 }
174 ]
175 };
176 },
177 computed: {
178 bmc() {
179 return this.$store.getters['bmc/bmc'];
180 },
181 items() {
182 if (this.bmc) {
183 return [this.bmc];
184 } else {
185 return [];
186 }
187 }
188 },
189 created() {
190 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500191 // Emit initial data fetch complete to parent component
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700192 this.$root.$emit('hardwareStatus::bmcManager::complete');
193 });
194 }
195};
196</script>