blob: 6533fd90d25a78b98fdd098d8ed2526dbfe0928f [file] [log] [blame]
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -07001<template>
Sandeepa Singh7affc522021-07-06 16:29:10 +05302 <page-section :section-title="$t('pageInventory.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
Sandeepa Singh78b6b532021-04-09 18:08:22 +053031 <!-- Toggle identify LED -->
32 <template #cell(identifyLed)="row">
33 <b-form-checkbox
34 v-if="hasIdentifyLed(row.item.identifyLed)"
35 v-model="row.item.identifyLed"
36 name="switch"
37 switch
38 @change="toggleIdentifyLedValue(row.item)"
39 >
40 <span v-if="row.item.identifyLed">
41 {{ $t('global.status.on') }}
42 </span>
43 <span v-else> {{ $t('global.status.off') }} </span>
44 </b-form-checkbox>
45 <div v-else>--</div>
46 </template>
47
Derick Montague602e98a2020-10-21 16:20:00 -050048 <template #row-details="{ item }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070049 <b-container fluid>
50 <b-row>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053051 <b-col class="mt-2" sm="6" xl="6">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070052 <dl>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053053 <!-- Name -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053054 <dt>{{ $t('pageInventory.table.name') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053055 <dd>{{ tableFormatter(item.name) }}</dd>
56 <!-- Part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053057 <dt>{{ $t('pageInventory.table.partNumber') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053058 <dd>{{ tableFormatter(item.partNumber) }}</dd>
59 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053060 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053061 <dd>{{ tableFormatter(item.serialNumber) }}</dd>
62 <!-- Spare part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053063 <dt>{{ $t('pageInventory.table.sparePartNumber') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053064 <dd>{{ tableFormatter(item.sparePartNumber) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070065 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053066 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070067 <dd>{{ tableFormatter(item.model) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053068 <!-- UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053069 <dt>{{ $t('pageInventory.table.uuid') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053070 <dd>{{ tableFormatter(item.uuid) }}</dd>
71 <!-- Service entry point UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053072 <dt>{{ $t('pageInventory.table.serviceEntryPointUuid') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053073 <dd>{{ tableFormatter(item.serviceEntryPointUuid) }}</dd>
74 </dl>
75 </b-col>
76 <b-col class="mt-2" sm="6" xl="6">
77 <dl>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070078 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053079 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070080 <dd>{{ tableFormatter(item.statusState) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053081 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053082 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053083 <dd>{{ tableFormatter(item.powerState) }}</dd>
84 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053085 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053086 <dd>{{ tableFormatter(item.healthRollup) }}</dd>
87 <!-- BMC date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053088 <dt>{{ $t('pageInventory.table.bmcDateTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053089 <dd>
90 {{ item.dateTime | formatDate }}
91 {{ item.dateTime | formatTime }}
92 </dd>
93 <!-- Reset date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053094 <dt>{{ $t('pageInventory.table.lastResetTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053095 <dd>
96 {{ item.lastResetTime | formatDate }}
97 {{ item.lastResetTime | formatTime }}
98 </dd>
99 </dl>
100 </b-col>
101 </b-row>
102 <div class="section-divider mb-3 mt-3"></div>
103 <b-row>
104 <b-col class="mt-2" sm="6" xl="6">
105 <dl>
106 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530107 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530108 <dd>{{ tableFormatter(item.manufacturer) }}</dd>
109 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530110 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530111 <dd>{{ tableFormatter(item.description) }}</dd>
112 <!-- Manager type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530113 <dt>{{ $t('pageInventory.table.managerType') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530114 <dd>{{ tableFormatter(item.managerType) }}</dd>
115 </dl>
116 </b-col>
117 <b-col class="mt-2" sm="6" xl="6">
Sandeepa Singh4c039192021-07-02 21:36:45 +0530118 <!-- Firmware Version -->
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530119 <dl>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530120 <dt>{{ $t('pageHardwareStatus.table.firmwareVersion') }}:</dt>
121 <dd>{{ item.firmwareVersion }}</dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530122 </dl>
123 <!-- Graphical console -->
124 <p class="mt-1 mb-2 h6 float-none m-0">
125 {{ $t('pageHardwareStatus.table.graphicalConsole') }}
126 </p>
127 <dl class="ml-4">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700128 <dt>
129 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
130 </dt>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530131 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700132 <dd>
133 {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }}
134 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530135 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530136 <dd>
137 {{ tableFormatter(item.graphicalConsoleMaxSessions) }}
138 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530139 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530140 <dd>
141 {{ tableFormatter(item.graphicalConsoleEnabled) }}
142 </dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530143 </dl>
144 <!-- Serial console -->
145 <p class="mt-1 mb-2 h6 float-none m-0">
146 {{ $t('pageHardwareStatus.table.serialConsole') }}
147 </p>
148 <dl class="ml-4">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700149 <dt>
150 {{ $t('pageHardwareStatus.table.connectTypesSupported') }}:
151 </dt>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530152 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700153 <dd>
154 {{ tableFormatterArray(item.serialConsoleConnectTypes) }}
155 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530156 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700157 <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530158 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700159 <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd>
160 </dl>
161 </b-col>
162 </b-row>
163 </b-container>
164 </template>
165 </b-table>
166 </page-section>
167</template>
168
169<script>
170import PageSection from '@/components/Global/PageSection';
171import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700172import StatusIcon from '@/components/Global/StatusIcon';
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530173import BVToastMixin from '@/components/Mixins/BVToastMixin';
SurenNewareba91c492020-10-27 14:18:54 +0530174import TableRowExpandMixin, {
175 expandRowLabel,
176} from '@/components/Mixins/TableRowExpandMixin';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700177import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700178
179export default {
180 components: { IconChevron, PageSection, StatusIcon },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530181 mixins: [BVToastMixin, TableRowExpandMixin, TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700182 data() {
183 return {
184 fields: [
185 {
186 key: 'expandRow',
187 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500188 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700189 },
190 {
191 key: 'id',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530192 label: this.$t('pageInventory.table.id'),
Derick Montague602e98a2020-10-21 16:20:00 -0500193 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700194 },
195 {
196 key: 'health',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530197 label: this.$t('pageInventory.table.health'),
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -0500198 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700199 },
200 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530201 key: 'locationNumber',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530202 label: this.$t('pageInventory.table.locationNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500203 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700204 },
205 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530206 key: 'identifyLed',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530207 label: this.$t('pageInventory.table.identifyLed'),
Derick Montague602e98a2020-10-21 16:20:00 -0500208 formatter: this.tableFormatter,
209 },
210 ],
SurenNewareba91c492020-10-27 14:18:54 +0530211 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700212 };
213 },
214 computed: {
215 bmc() {
216 return this.$store.getters['bmc/bmc'];
217 },
218 items() {
219 if (this.bmc) {
220 return [this.bmc];
221 } else {
222 return [];
223 }
Derick Montague602e98a2020-10-21 16:20:00 -0500224 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700225 },
226 created() {
227 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500228 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530229 this.$root.$emit('hardware-status-bmc-manager-complete');
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700230 });
Derick Montague602e98a2020-10-21 16:20:00 -0500231 },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530232 methods: {
233 toggleIdentifyLedValue(row) {
234 this.$store
235 .dispatch('bmc/updateIdentifyLedValue', {
236 uri: row.uri,
237 identifyLed: row.identifyLed,
238 })
239 .catch(({ message }) => this.errorToast(message));
240 },
241 // TO DO: remove hasIdentifyLed method once the following story is merged:
242 // https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43179
243 hasIdentifyLed(identifyLed) {
244 return typeof identifyLed === 'boolean';
245 },
246 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700247};
248</script>