blob: a6342089f0c2306fb27d2fcc1ff84d1183424dea [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 -->
Derick Montague602e98a2020-10-21 16:20:00 -050012 <template #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"
Dixsie Wolmers30f11f82020-11-10 16:07:56 -060017 :title="expandRowLabel"
18 class="btn-icon-only"
Dixsie Wolmersb53e0862020-09-08 14:13:38 -050019 @click="toggleRowDetails(row)"
Dixsie Wolmers83133762020-07-15 08:45:19 -050020 >
Dixsie Wolmers30f11f82020-11-10 16:07:56 -060021 <icon-chevron />
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070022 </b-button>
23 </template>
24
25 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050026 <template #cell(health)="{ value }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070027 <status-icon :status="statusIcon(value)" />
28 {{ value }}
29 </template>
30
Derick Montague602e98a2020-10-21 16:20:00 -050031 <template #row-details="{ item }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070032 <b-container fluid>
33 <b-row>
34 <b-col sm="6">
35 <dl>
36 <!-- Description -->
37 <dt class="d-block">
38 {{ $t('pageHardwareStatus.table.description') }}:
39 </dt>
40 <dd class="mb-4">
41 {{ tableFormatter(item.description) }}
42 </dd>
43 <br />
44 <!-- Firmware version -->
45 <dt class="d-block">
46 {{ $t('pageHardwareStatus.table.firmwareVersion') }}:
47 </dt>
48 <dd class="mb-4">
49 {{ tableFormatter(item.firmwareVersion) }}
50 </dd>
51 <br />
52 <!-- Service entry point UUID -->
53 <dt class="d-block">
54 {{ $t('pageHardwareStatus.table.serviceEntryPointUuid') }}:
55 </dt>
56 <dd class="mb-4">
57 {{ tableFormatter(item.serviceEntryPointUuid) }}
58 </dd>
59 <br />
60 <!-- UUID -->
61 <dt class="d-block">
62 {{ $t('pageHardwareStatus.table.uuid') }}:
63 </dt>
64 <dd class="mb-4">
65 {{ tableFormatter(item.uuid) }}
66 </dd>
67 </dl>
68 </b-col>
69 <b-col sm="6">
70 <dl>
71 <!-- Power state -->
72 <dt>{{ $t('pageHardwareStatus.table.powerState') }}:</dt>
73 <dd>{{ tableFormatter(item.powerState) }}</dd>
74 <br />
75
76 <!-- Model -->
77 <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt>
78 <dd>{{ tableFormatter(item.model) }}</dd>
79 <br />
80
81 <!-- Health rollup -->
82 <dt>
83 {{ $t('pageHardwareStatus.table.statusHealthRollup') }}:
84 </dt>
85 <dd>{{ tableFormatter(item.healthRollup) }}</dd>
86 <br />
87
88 <!-- Status state -->
89 <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt>
90 <dd>{{ tableFormatter(item.statusState) }}</dd>
91 <br />
92
93 <!-- Graphical console -->
94 <dt class="font-weight-bold mt-3 mb-2 d-block">
95 {{ $t('pageHardwareStatus.table.graphicalConsole') }}
96 </dt>
97 <dt>
98 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
99 </dt>
100 <dd>
101 {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }}
102 </dd>
103 <br />
104 <dt>
105 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
106 </dt>
107 <dd>{{ tableFormatter(item.graphicalConsoleMaxSessions) }}</dd>
108 <br />
109 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
110 <dd>{{ tableFormatter(item.graphicalConsoleEnabled) }}</dd>
111 <br />
112
113 <!-- Serial console -->
114 <dt class="font-weight-bold mt-3 mb-2 d-block">
115 {{ $t('pageHardwareStatus.table.serialConsole') }}
116 </dt>
117 <dt>
118 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
119 </dt>
120 <dd>
121 {{ tableFormatterArray(item.serialConsoleConnectTypes) }}
122 </dd>
123 <br />
124 <dt>
125 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
126 </dt>
127 <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd>
128 <br />
129 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
130 <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd>
131 </dl>
132 </b-col>
133 </b-row>
134 </b-container>
135 </template>
136 </b-table>
137 </page-section>
138</template>
139
140<script>
141import PageSection from '@/components/Global/PageSection';
142import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
143
144import StatusIcon from '@/components/Global/StatusIcon';
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500145
146import TableRowExpandMixin from '@/components/Mixins/TableRowExpandMixin';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700147import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700148
149export default {
150 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500151 mixins: [TableRowExpandMixin, TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700152 data() {
153 return {
154 fields: [
155 {
156 key: 'expandRow',
157 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500158 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700159 },
160 {
161 key: 'id',
162 label: this.$t('pageHardwareStatus.table.id'),
Derick Montague602e98a2020-10-21 16:20:00 -0500163 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700164 },
165 {
166 key: 'health',
167 label: this.$t('pageHardwareStatus.table.health'),
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -0500168 formatter: this.tableFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500169 tdClass: 'text-nowrap',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700170 },
171 {
172 key: 'partNumber',
173 label: this.$t('pageHardwareStatus.table.partNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500174 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700175 },
176 {
177 key: 'serialNumber',
178 label: this.$t('pageHardwareStatus.table.serialNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500179 formatter: this.tableFormatter,
180 },
181 ],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700182 };
183 },
184 computed: {
185 bmc() {
186 return this.$store.getters['bmc/bmc'];
187 },
188 items() {
189 if (this.bmc) {
190 return [this.bmc];
191 } else {
192 return [];
193 }
Derick Montague602e98a2020-10-21 16:20:00 -0500194 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700195 },
196 created() {
197 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500198 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530199 this.$root.$emit('hardware-status-bmc-manager-complete');
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700200 });
Derick Montague602e98a2020-10-21 16:20:00 -0500201 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700202};
203</script>