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