blob: 428f52282c8bec3fe5fd4c8608ff1b1b90f7df0d [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 Singh5287a8b2021-08-16 15:00:27 +0530120 <dt>{{ $t('pageInventory.table.firmwareVersion') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530121 <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">
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530125 {{ $t('pageInventory.table.graphicalConsole') }}
Sandeepa Singh4c039192021-07-02 21:36:45 +0530126 </p>
127 <dl class="ml-4">
Sandeepa Singh7affc522021-07-06 16:29:10 +0530128 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700129 <dd>
130 {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }}
131 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530132 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530133 <dd>
134 {{ tableFormatter(item.graphicalConsoleMaxSessions) }}
135 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530136 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530137 <dd>
138 {{ tableFormatter(item.graphicalConsoleEnabled) }}
139 </dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530140 </dl>
141 <!-- Serial console -->
142 <p class="mt-1 mb-2 h6 float-none m-0">
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530143 {{ $t('pageInventory.table.serialConsole') }}
Sandeepa Singh4c039192021-07-02 21:36:45 +0530144 </p>
145 <dl class="ml-4">
Sandeepa Singh7affc522021-07-06 16:29:10 +0530146 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700147 <dd>
148 {{ tableFormatterArray(item.serialConsoleConnectTypes) }}
149 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530150 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700151 <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530152 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700153 <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd>
154 </dl>
155 </b-col>
156 </b-row>
157 </b-container>
158 </template>
159 </b-table>
160 </page-section>
161</template>
162
163<script>
164import PageSection from '@/components/Global/PageSection';
165import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700166import StatusIcon from '@/components/Global/StatusIcon';
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530167import BVToastMixin from '@/components/Mixins/BVToastMixin';
SurenNewareba91c492020-10-27 14:18:54 +0530168import TableRowExpandMixin, {
169 expandRowLabel,
170} from '@/components/Mixins/TableRowExpandMixin';
Yoshie Muranaka386df452020-06-18 12:45:13 -0700171import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700172
173export default {
174 components: { IconChevron, PageSection, StatusIcon },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530175 mixins: [BVToastMixin, TableRowExpandMixin, TableDataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700176 data() {
177 return {
178 fields: [
179 {
180 key: 'expandRow',
181 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500182 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700183 },
184 {
185 key: 'id',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530186 label: this.$t('pageInventory.table.id'),
Derick Montague602e98a2020-10-21 16:20:00 -0500187 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700188 },
189 {
190 key: 'health',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530191 label: this.$t('pageInventory.table.health'),
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -0500192 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700193 },
194 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530195 key: 'locationNumber',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530196 label: this.$t('pageInventory.table.locationNumber'),
Derick Montague602e98a2020-10-21 16:20:00 -0500197 formatter: this.tableFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700198 },
199 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530200 key: 'identifyLed',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530201 label: this.$t('pageInventory.table.identifyLed'),
Derick Montague602e98a2020-10-21 16:20:00 -0500202 formatter: this.tableFormatter,
203 },
204 ],
SurenNewareba91c492020-10-27 14:18:54 +0530205 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700206 };
207 },
208 computed: {
209 bmc() {
210 return this.$store.getters['bmc/bmc'];
211 },
212 items() {
213 if (this.bmc) {
214 return [this.bmc];
215 } else {
216 return [];
217 }
Derick Montague602e98a2020-10-21 16:20:00 -0500218 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700219 },
220 created() {
221 this.$store.dispatch('bmc/getBmcInfo').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500222 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530223 this.$root.$emit('hardware-status-bmc-manager-complete');
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700224 });
Derick Montague602e98a2020-10-21 16:20:00 -0500225 },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530226 methods: {
227 toggleIdentifyLedValue(row) {
228 this.$store
229 .dispatch('bmc/updateIdentifyLedValue', {
230 uri: row.uri,
231 identifyLed: row.identifyLed,
232 })
233 .catch(({ message }) => this.errorToast(message));
234 },
235 // TO DO: remove hasIdentifyLed method once the following story is merged:
236 // https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43179
237 hasIdentifyLed(identifyLed) {
238 return typeof identifyLed === 'boolean';
239 },
240 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700241};
242</script>