blob: 48b914f4478a39cfe730eefbc48bd423699fd95f [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')"
Kenneth Fullbright41057852021-12-27 16:19:37 -060010 :busy="isBusy"
SurenNeware307382e2020-07-27 20:45:14 +053011 >
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070012 <!-- Expand chevron icon -->
Derick Montague602e98a2020-10-21 16:20:00 -050013 <template #cell(expandRow)="row">
Dixsie Wolmers83133762020-07-15 08:45:19 -050014 <b-button
15 variant="link"
16 data-test-id="hardwareStatus-button-expandBmc"
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 />
SurenNeware6e2cb972020-12-24 20:58:16 +053022 <span class="sr-only">{{ expandRowLabel }}</span>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070023 </b-button>
24 </template>
25
26 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050027 <template #cell(health)="{ value }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070028 <status-icon :status="statusIcon(value)" />
29 {{ value }}
30 </template>
31
Sandeepa Singh78b6b532021-04-09 18:08:22 +053032 <!-- Toggle identify LED -->
33 <template #cell(identifyLed)="row">
34 <b-form-checkbox
35 v-if="hasIdentifyLed(row.item.identifyLed)"
36 v-model="row.item.identifyLed"
37 name="switch"
38 switch
39 @change="toggleIdentifyLedValue(row.item)"
40 >
41 <span v-if="row.item.identifyLed">
42 {{ $t('global.status.on') }}
43 </span>
44 <span v-else> {{ $t('global.status.off') }} </span>
45 </b-form-checkbox>
46 <div v-else>--</div>
47 </template>
48
Derick Montague602e98a2020-10-21 16:20:00 -050049 <template #row-details="{ item }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070050 <b-container fluid>
51 <b-row>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053052 <b-col class="mt-2" sm="6" xl="6">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070053 <dl>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053054 <!-- Name -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053055 <dt>{{ $t('pageInventory.table.name') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050056 <dd>{{ dataFormatter(item.name) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053057 <!-- Part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053058 <dt>{{ $t('pageInventory.table.partNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050059 <dd>{{ dataFormatter(item.partNumber) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053060 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053061 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050062 <dd>{{ dataFormatter(item.serialNumber) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053063 <!-- Spare part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053064 <dt>{{ $t('pageInventory.table.sparePartNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050065 <dd>{{ dataFormatter(item.sparePartNumber) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070066 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053067 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050068 <dd>{{ dataFormatter(item.model) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053069 <!-- UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053070 <dt>{{ $t('pageInventory.table.uuid') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050071 <dd>{{ dataFormatter(item.uuid) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053072 <!-- Service entry point UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053073 <dt>{{ $t('pageInventory.table.serviceEntryPointUuid') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050074 <dd>{{ dataFormatter(item.serviceEntryPointUuid) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053075 </dl>
76 </b-col>
77 <b-col class="mt-2" sm="6" xl="6">
78 <dl>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070079 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053080 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050081 <dd>{{ dataFormatter(item.statusState) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053082 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053083 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050084 <dd>{{ dataFormatter(item.powerState) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053085 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053086 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050087 <dd>{{ dataFormatter(item.healthRollup) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053088 <!-- BMC date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053089 <dt>{{ $t('pageInventory.table.bmcDateTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053090 <dd>
91 {{ item.dateTime | formatDate }}
92 {{ item.dateTime | formatTime }}
93 </dd>
94 <!-- Reset date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053095 <dt>{{ $t('pageInventory.table.lastResetTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053096 <dd>
97 {{ item.lastResetTime | formatDate }}
98 {{ item.lastResetTime | formatTime }}
99 </dd>
100 </dl>
101 </b-col>
102 </b-row>
103 <div class="section-divider mb-3 mt-3"></div>
104 <b-row>
105 <b-col class="mt-2" sm="6" xl="6">
106 <dl>
107 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530108 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500109 <dd>{{ dataFormatter(item.manufacturer) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530110 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530111 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500112 <dd>{{ dataFormatter(item.description) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530113 <!-- Manager type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530114 <dt>{{ $t('pageInventory.table.managerType') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500115 <dd>{{ dataFormatter(item.managerType) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530116 </dl>
117 </b-col>
118 <b-col class="mt-2" sm="6" xl="6">
Sandeepa Singh4c039192021-07-02 21:36:45 +0530119 <!-- Firmware Version -->
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530120 <dl>
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530121 <dt>{{ $t('pageInventory.table.firmwareVersion') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530122 <dd>{{ item.firmwareVersion }}</dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530123 </dl>
124 <!-- Graphical console -->
125 <p class="mt-1 mb-2 h6 float-none m-0">
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530126 {{ $t('pageInventory.table.graphicalConsole') }}
Sandeepa Singh4c039192021-07-02 21:36:45 +0530127 </p>
128 <dl class="ml-4">
Sandeepa Singh7affc522021-07-06 16:29:10 +0530129 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700130 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500131 {{ dataFormatterArray(item.graphicalConsoleConnectTypes) }}
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700132 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530133 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530134 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500135 {{ dataFormatter(item.graphicalConsoleMaxSessions) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530136 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530137 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530138 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500139 {{ dataFormatter(item.graphicalConsoleEnabled) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530140 </dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530141 </dl>
142 <!-- Serial console -->
143 <p class="mt-1 mb-2 h6 float-none m-0">
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530144 {{ $t('pageInventory.table.serialConsole') }}
Sandeepa Singh4c039192021-07-02 21:36:45 +0530145 </p>
146 <dl class="ml-4">
Sandeepa Singh7affc522021-07-06 16:29:10 +0530147 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700148 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500149 {{ dataFormatterArray(item.serialConsoleConnectTypes) }}
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700150 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530151 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500152 <dd>{{ dataFormatter(item.serialConsoleMaxSessions) }}</dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530153 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500154 <dd>{{ dataFormatter(item.serialConsoleEnabled) }}</dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700155 </dl>
156 </b-col>
157 </b-row>
158 </b-container>
159 </template>
160 </b-table>
161 </page-section>
162</template>
163
164<script>
165import PageSection from '@/components/Global/PageSection';
166import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700167import StatusIcon from '@/components/Global/StatusIcon';
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530168import BVToastMixin from '@/components/Mixins/BVToastMixin';
SurenNewareba91c492020-10-27 14:18:54 +0530169import TableRowExpandMixin, {
170 expandRowLabel,
171} from '@/components/Mixins/TableRowExpandMixin';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500172import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700173
174export default {
175 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500176 mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700177 data() {
178 return {
Kenneth Fullbright41057852021-12-27 16:19:37 -0600179 isBusy: true,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700180 fields: [
181 {
182 key: 'expandRow',
183 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500184 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700185 },
186 {
187 key: 'id',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530188 label: this.$t('pageInventory.table.id'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500189 formatter: this.dataFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700190 },
191 {
192 key: 'health',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530193 label: this.$t('pageInventory.table.health'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500194 formatter: this.dataFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700195 },
196 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530197 key: 'locationNumber',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530198 label: this.$t('pageInventory.table.locationNumber'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500199 formatter: this.dataFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700200 },
201 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530202 key: 'identifyLed',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530203 label: this.$t('pageInventory.table.identifyLed'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500204 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500205 },
206 ],
SurenNewareba91c492020-10-27 14:18:54 +0530207 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700208 };
209 },
210 computed: {
211 bmc() {
212 return this.$store.getters['bmc/bmc'];
213 },
214 items() {
215 if (this.bmc) {
216 return [this.bmc];
217 } else {
218 return [];
219 }
Derick Montague602e98a2020-10-21 16:20:00 -0500220 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700221 },
222 created() {
223 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500224 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530225 this.$root.$emit('hardware-status-bmc-manager-complete');
Kenneth Fullbright41057852021-12-27 16:19:37 -0600226 this.isBusy = false;
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700227 });
Derick Montague602e98a2020-10-21 16:20:00 -0500228 },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530229 methods: {
230 toggleIdentifyLedValue(row) {
231 this.$store
232 .dispatch('bmc/updateIdentifyLedValue', {
233 uri: row.uri,
234 identifyLed: row.identifyLed,
235 })
236 .catch(({ message }) => this.errorToast(message));
237 },
238 // TO DO: remove hasIdentifyLed method once the following story is merged:
239 // https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43179
240 hasIdentifyLed(identifyLed) {
241 return typeof identifyLed === 'boolean';
242 },
243 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700244};
245</script>