blob: e62f5006e5e8c15d48b0c3d5e95e8567cdf91ac5 [file] [log] [blame]
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07001<template>
Sandeepa Singh7affc522021-07-06 16:29:10 +05302 <page-section :section-title="$t('pageInventory.system')">
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 show-empty
7 :items="systems"
8 :fields="fields"
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 Muranaka56ee7692020-05-28 13:28:29 -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-expandSystem"
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 Muranaka56ee7692020-05-28 13:28:29 -070023 </b-button>
24 </template>
25
26 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050027 <template #cell(health)="{ value }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070028 <status-icon :status="statusIcon(value)" />
29 {{ value }}
30 </template>
31
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053032 <template #cell(locationIndicatorActive)="{ item }">
33 <b-form-checkbox
Sukanya Pandey05388962021-06-10 15:35:21 +053034 id="identifyLedSwitchSystem"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053035 v-model="item.locationIndicatorActive"
Sukanya Pandey05388962021-06-10 15:35:21 +053036 data-test-id="inventorySystem-toggle-identifyLed"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053037 switch
38 @change="toggleIdentifyLedSwitch"
39 >
Sukanya Pandey05388962021-06-10 15:35:21 +053040 <span v-if="item.locationIndicatorActive">
41 {{ $t('global.status.on') }}
42 </span>
43 <span v-else>{{ $t('global.status.off') }}</span>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053044 </b-form-checkbox>
45 </template>
46
Derick Montague602e98a2020-10-21 16:20:00 -050047 <template #row-details="{ item }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070048 <b-container fluid>
49 <b-row>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053050 <b-col class="mt-2" sm="6">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070051 <dl>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053052 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053053 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050054 <dd>{{ dataFormatter(item.serialNumber) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053055 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053056 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050057 <dd>{{ dataFormatter(item.model) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070058 <!-- Asset tag -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053059 <dt>{{ $t('pageInventory.table.assetTag') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053060 <dd class="mb-2">
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050061 {{ dataFormatter(item.assetTag) }}
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053062 </dd>
63 </dl>
64 </b-col>
65 <b-col class="mt-2" sm="6">
66 <dl>
67 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053068 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050069 <dd>{{ dataFormatter(item.statusState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053070 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053071 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050072 <dd>{{ dataFormatter(item.powerState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053073 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053074 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050075 <dd>{{ dataFormatter(item.healthRollup) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053076 </dl>
77 </b-col>
78 </b-row>
79 <div class="section-divider mb-3 mt-3"></div>
80 <b-row>
81 <b-col class="mt-1" sm="6">
82 <dl>
83 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053084 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Thang Q. Nguyenc6899362021-10-20 02:08:49 +000085 <dd>{{ dataFormatter(item.manufacturer) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070086 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053087 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050088 <dd>{{ dataFormatter(item.description) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053089 <!-- Sub Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053090 <dt>{{ $t('pageInventory.table.subModel') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053091 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050092 {{ dataFormatter(item.subModel) }}
SurenNewarebbf896c2021-01-27 21:50:22 +053093 </dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053094 <!-- System Type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053095 <dt>{{ $t('pageInventory.table.systemType') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053096 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050097 {{ dataFormatter(item.systemType) }}
SurenNewarebbf896c2021-01-27 21:50:22 +053098 </dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070099 </dl>
100 </b-col>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530101 <b-col sm="6">
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530102 <!-- Memory Summary -->
103 <p class="mt-1 mb-2 h6 float-none m-0">
104 {{ $t('pageInventory.table.memorySummary') }}
105 </p>
106 <dl class="ml-4">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700107 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530108 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500109 <dd>{{ dataFormatter(item.memorySummaryState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530110 <!-- Health -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530111 <dt>{{ $t('pageInventory.table.health') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500112 <dd>{{ dataFormatter(item.memorySummaryHealth) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530113 <!-- Health Roll -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530114 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530115 <dd>{{ dataFormatter(item.memorySummaryHealthRollup) }}</dd>
116 <!-- Total system memory -->
117 <dt>{{ $t('pageInventory.table.totalSystemMemoryGiB') }}:</dt>
Glukhov Mikhaild0b078f2022-12-24 12:16:53 +0300118 <dd>
119 {{ dataFormatter(item.totalSystemMemoryGiB) }}
120 {{ $t('unit.GiB') }}
121 </dd>
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530122 </dl>
123 <!-- Processor Summary -->
124 <p class="mt-1 mb-2 h6 float-none m-0">
125 {{ $t('pageInventory.table.processorSummary') }}
126 </p>
127 <dl class="ml-4">
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530128 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530129 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500130 <dd>{{ dataFormatter(item.processorSummaryState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530131 <!-- Health -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530132 <dt>{{ $t('pageInventory.table.health') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500133 <dd>{{ dataFormatter(item.processorSummaryHealth) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530134 <!-- Health Rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530135 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500136 <dd>{{ dataFormatter(item.processorSummaryHealthRoll) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530137 <!-- Count -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530138 <dt>{{ $t('pageInventory.table.count') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500139 <dd>{{ dataFormatter(item.processorSummaryCount) }}</dd>
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530140 <!-- Core Count -->
141 <dt>{{ $t('pageInventory.table.coreCount') }}:</dt>
142 <dd>{{ dataFormatter(item.processorSummaryCoreCount) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700143 </dl>
144 </b-col>
145 </b-row>
146 </b-container>
147 </template>
148 </b-table>
149 </page-section>
150</template>
151
152<script>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530153import BVToastMixin from '@/components/Mixins/BVToastMixin';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700154import PageSection from '@/components/Global/PageSection';
155import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
156
157import StatusIcon from '@/components/Global/StatusIcon';
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500158
SurenNewareba91c492020-10-27 14:18:54 +0530159import TableRowExpandMixin, {
160 expandRowLabel,
161} from '@/components/Mixins/TableRowExpandMixin';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500162import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700163
164export default {
165 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500166 mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700167 data() {
168 return {
Kenneth Fullbright41057852021-12-27 16:19:37 -0600169 isBusy: true,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700170 fields: [
171 {
172 key: 'expandRow',
173 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500174 tdClass: 'table-row-expand',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700175 },
176 {
177 key: 'id',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530178 label: this.$t('pageInventory.table.id'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500179 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700180 },
181 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530182 key: 'hardwareType',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530183 label: this.$t('pageInventory.table.hardwareType'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500184 formatter: this.dataFormatter,
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530185 tdClass: 'text-nowrap',
186 },
187 {
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700188 key: 'health',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530189 label: this.$t('pageInventory.table.health'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500190 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500191 tdClass: 'text-nowrap',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700192 },
193 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530194 key: 'locationNumber',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530195 label: this.$t('pageInventory.table.locationNumber'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500196 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700197 },
198 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530199 key: 'locationIndicatorActive',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530200 label: this.$t('pageInventory.table.identifyLed'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500201 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500202 },
203 ],
SurenNewareba91c492020-10-27 14:18:54 +0530204 expandRowLabel: expandRowLabel,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700205 };
206 },
207 computed: {
208 systems() {
209 return this.$store.getters['system/systems'];
Derick Montague602e98a2020-10-21 16:20:00 -0500210 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700211 },
212 created() {
213 this.$store.dispatch('system/getSystem').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500214 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530215 this.$root.$emit('hardware-status-system-complete');
Kenneth Fullbright41057852021-12-27 16:19:37 -0600216 this.isBusy = false;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700217 });
Derick Montague602e98a2020-10-21 16:20:00 -0500218 },
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530219 methods: {
220 toggleIdentifyLedSwitch(state) {
221 this.$store
222 .dispatch('system/changeIdentifyLedState', state)
223 .catch(({ message }) => this.errorToast(message));
224 },
225 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700226};
227</script>