blob: 29a6679bd4a342ccc66255221a3e41fe116293b6 [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
SurenNewareba91c492020-10-27 14:18:54 +0530146import TableRowExpandMixin, {
147 expandRowLabel,
148} from '@/components/Mixins/TableRowExpandMixin';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700149import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700150
151export default {
152 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500153 mixins: [TableRowExpandMixin, TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700154 data() {
155 return {
156 fields: [
157 {
158 key: 'expandRow',
159 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500160 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700161 },
162 {
163 key: 'id',
164 label: this.$t('pageHardwareStatus.table.id'),
Derick Montague602e98a2020-10-21 16:20:00 -0500165 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700166 },
167 {
168 key: 'health',
169 label: this.$t('pageHardwareStatus.table.health'),
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -0500170 formatter: this.tableFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500171 tdClass: 'text-nowrap',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700172 },
173 {
174 key: 'partNumber',
175 label: this.$t('pageHardwareStatus.table.partNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500176 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700177 },
178 {
179 key: 'serialNumber',
180 label: this.$t('pageHardwareStatus.table.serialNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500181 formatter: this.tableFormatter,
182 },
183 ],
SurenNewareba91c492020-10-27 14:18:54 +0530184 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700185 };
186 },
187 computed: {
188 bmc() {
189 return this.$store.getters['bmc/bmc'];
190 },
191 items() {
192 if (this.bmc) {
193 return [this.bmc];
194 } else {
195 return [];
196 }
Derick Montague602e98a2020-10-21 16:20:00 -0500197 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700198 },
199 created() {
200 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500201 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530202 this.$root.$emit('hardware-status-bmc-manager-complete');
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700203 });
Derick Montague602e98a2020-10-21 16:20:00 -0500204 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700205};
206</script>