blob: 2feced8645094d8dbb90b4570a6b661077d5e0a8 [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 Wolmers30f11f82020-11-10 16:07:56 -060016 :title="expandRowLabel"
17 class="btn-icon-only"
Dixsie Wolmersb53e0862020-09-08 14:13:38 -050018 @click="toggleRowDetails(row)"
Dixsie Wolmers83133762020-07-15 08:45:19 -050019 >
Dixsie Wolmers30f11f82020-11-10 16:07:56 -060020 <icon-chevron />
SurenNeware6e2cb972020-12-24 20:58:16 +053021 <span class="sr-only">{{ expandRowLabel }}</span>
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 -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050037 <dt class="float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070038 {{ $t('pageHardwareStatus.table.description') }}:
39 </dt>
40 <dd class="mb-4">
41 {{ tableFormatter(item.description) }}
42 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070043 <!-- Firmware version -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050044 <dt class="float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070045 {{ $t('pageHardwareStatus.table.firmwareVersion') }}:
46 </dt>
47 <dd class="mb-4">
48 {{ tableFormatter(item.firmwareVersion) }}
49 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070050 <!-- Service entry point UUID -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050051 <dt class="float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070052 {{ $t('pageHardwareStatus.table.serviceEntryPointUuid') }}:
53 </dt>
54 <dd class="mb-4">
55 {{ tableFormatter(item.serviceEntryPointUuid) }}
56 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070057 <!-- UUID -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050058 <dt class="float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070059 {{ $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>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070071
72 <!-- Model -->
73 <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt>
74 <dd>{{ tableFormatter(item.model) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070075
76 <!-- Health rollup -->
77 <dt>
78 {{ $t('pageHardwareStatus.table.statusHealthRollup') }}:
79 </dt>
80 <dd>{{ tableFormatter(item.healthRollup) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070081
82 <!-- Status state -->
83 <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt>
84 <dd>{{ tableFormatter(item.statusState) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070085
86 <!-- Graphical console -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050087 <dt class="font-weight-bold mt-3 mb-2 float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070088 {{ $t('pageHardwareStatus.table.graphicalConsole') }}
89 </dt>
90 <dt>
91 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
92 </dt>
93 <dd>
94 {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }}
95 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070096 <dt>
97 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
98 </dt>
99 <dd>{{ tableFormatter(item.graphicalConsoleMaxSessions) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700100 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
101 <dd>{{ tableFormatter(item.graphicalConsoleEnabled) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700102
103 <!-- Serial console -->
Dixsie Wolmers25e17a12021-06-25 08:15:05 -0500104 <dt class="font-weight-bold mt-3 mb-2 float-none">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700105 {{ $t('pageHardwareStatus.table.serialConsole') }}
106 </dt>
107 <dt>
108 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
109 </dt>
110 <dd>
111 {{ tableFormatterArray(item.serialConsoleConnectTypes) }}
112 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700113 <dt>
114 {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}:
115 </dt>
116 <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700117 <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt>
118 <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd>
119 </dl>
120 </b-col>
121 </b-row>
122 </b-container>
123 </template>
124 </b-table>
125 </page-section>
126</template>
127
128<script>
129import PageSection from '@/components/Global/PageSection';
130import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
131
132import StatusIcon from '@/components/Global/StatusIcon';
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500133
SurenNewareba91c492020-10-27 14:18:54 +0530134import TableRowExpandMixin, {
135 expandRowLabel,
136} from '@/components/Mixins/TableRowExpandMixin';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700137import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700138
139export default {
140 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500141 mixins: [TableRowExpandMixin, TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700142 data() {
143 return {
144 fields: [
145 {
146 key: 'expandRow',
147 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500148 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700149 },
150 {
151 key: 'id',
152 label: this.$t('pageHardwareStatus.table.id'),
Derick Montague602e98a2020-10-21 16:20:00 -0500153 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700154 },
155 {
156 key: 'health',
157 label: this.$t('pageHardwareStatus.table.health'),
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -0500158 formatter: this.tableFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500159 tdClass: 'text-nowrap',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700160 },
161 {
162 key: 'partNumber',
163 label: this.$t('pageHardwareStatus.table.partNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500164 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700165 },
166 {
167 key: 'serialNumber',
168 label: this.$t('pageHardwareStatus.table.serialNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500169 formatter: this.tableFormatter,
170 },
171 ],
SurenNewareba91c492020-10-27 14:18:54 +0530172 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700173 };
174 },
175 computed: {
176 bmc() {
177 return this.$store.getters['bmc/bmc'];
178 },
179 items() {
180 if (this.bmc) {
181 return [this.bmc];
182 } else {
183 return [];
184 }
Derick Montague602e98a2020-10-21 16:20:00 -0500185 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700186 },
187 created() {
188 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500189 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530190 this.$root.$emit('hardware-status-bmc-manager-complete');
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700191 });
Derick Montague602e98a2020-10-21 16:20:00 -0500192 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700193};
194</script>