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