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