blob: 93e65bbe379db6dc0a03e611053d672723cd0bc3 [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')"
10 >
Yoshie Muranaka56ee7692020-05-28 13:28:29 -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-expandSystem"
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 Muranaka56ee7692020-05-28 13:28:29 -070022 </b-button>
23 </template>
24
25 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050026 <template #cell(health)="{ value }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070027 <status-icon :status="statusIcon(value)" />
28 {{ value }}
29 </template>
30
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053031 <template #cell(locationIndicatorActive)="{ item }">
32 <b-form-checkbox
Sukanya Pandey05388962021-06-10 15:35:21 +053033 id="identifyLedSwitchSystem"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053034 v-model="item.locationIndicatorActive"
Sukanya Pandey05388962021-06-10 15:35:21 +053035 data-test-id="inventorySystem-toggle-identifyLed"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053036 switch
37 @change="toggleIdentifyLedSwitch"
38 >
Sukanya Pandey05388962021-06-10 15:35:21 +053039 <span v-if="item.locationIndicatorActive">
40 {{ $t('global.status.on') }}
41 </span>
42 <span v-else>{{ $t('global.status.off') }}</span>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053043 </b-form-checkbox>
44 </template>
45
Derick Montague602e98a2020-10-21 16:20:00 -050046 <template #row-details="{ item }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070047 <b-container fluid>
48 <b-row>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053049 <b-col class="mt-2" sm="6">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070050 <dl>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053051 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053052 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050053 <dd>{{ dataFormatter(item.serialNumber) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053054 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053055 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050056 <dd>{{ dataFormatter(item.model) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070057 <!-- Asset tag -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053058 <dt>{{ $t('pageInventory.table.assetTag') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053059 <dd class="mb-2">
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050060 {{ dataFormatter(item.assetTag) }}
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053061 </dd>
62 </dl>
63 </b-col>
64 <b-col class="mt-2" sm="6">
65 <dl>
66 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053067 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050068 <dd>{{ dataFormatter(item.statusState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053069 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053070 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050071 <dd>{{ dataFormatter(item.powerState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053072 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053073 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050074 <dd>{{ dataFormatter(item.healthRollup) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053075 </dl>
76 </b-col>
77 </b-row>
78 <div class="section-divider mb-3 mt-3"></div>
79 <b-row>
80 <b-col class="mt-1" sm="6">
81 <dl>
82 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053083 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Thang Q. Nguyenc6899362021-10-20 02:08:49 +000084 <dd>{{ dataFormatter(item.manufacturer) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070085 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053086 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050087 <dd>{{ dataFormatter(item.description) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053088 <!-- Sub Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053089 <dt>{{ $t('pageInventory.table.subModel') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053090 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050091 {{ dataFormatter(item.subModel) }}
SurenNewarebbf896c2021-01-27 21:50:22 +053092 </dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053093 <!-- System Type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053094 <dt>{{ $t('pageInventory.table.systemType') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053095 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050096 {{ dataFormatter(item.systemType) }}
SurenNewarebbf896c2021-01-27 21:50:22 +053097 </dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070098 </dl>
99 </b-col>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530100 <b-col sm="6">
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530101 <!-- Memory Summary -->
102 <p class="mt-1 mb-2 h6 float-none m-0">
103 {{ $t('pageInventory.table.memorySummary') }}
104 </p>
105 <dl class="ml-4">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700106 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530107 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500108 <dd>{{ dataFormatter(item.memorySummaryState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530109 <!-- Health -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530110 <dt>{{ $t('pageInventory.table.health') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500111 <dd>{{ dataFormatter(item.memorySummaryHealth) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530112 <!-- Health Roll -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530113 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530114 <dd>{{ dataFormatter(item.memorySummaryHealthRollup) }}</dd>
115 <!-- Total system memory -->
116 <dt>{{ $t('pageInventory.table.totalSystemMemoryGiB') }}:</dt>
117 <dd>{{ dataFormatter(item.totalSystemMemoryGiB) }}GB</dd>
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530118 </dl>
119 <!-- Processor Summary -->
120 <p class="mt-1 mb-2 h6 float-none m-0">
121 {{ $t('pageInventory.table.processorSummary') }}
122 </p>
123 <dl class="ml-4">
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530124 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530125 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500126 <dd>{{ dataFormatter(item.processorSummaryState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530127 <!-- Health -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530128 <dt>{{ $t('pageInventory.table.health') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500129 <dd>{{ dataFormatter(item.processorSummaryHealth) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530130 <!-- Health Rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530131 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500132 <dd>{{ dataFormatter(item.processorSummaryHealthRoll) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530133 <!-- Count -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530134 <dt>{{ $t('pageInventory.table.count') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500135 <dd>{{ dataFormatter(item.processorSummaryCount) }}</dd>
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530136 <!-- Core Count -->
137 <dt>{{ $t('pageInventory.table.coreCount') }}:</dt>
138 <dd>{{ dataFormatter(item.processorSummaryCoreCount) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700139 </dl>
140 </b-col>
141 </b-row>
142 </b-container>
143 </template>
144 </b-table>
145 </page-section>
146</template>
147
148<script>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530149import BVToastMixin from '@/components/Mixins/BVToastMixin';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700150import PageSection from '@/components/Global/PageSection';
151import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
152
153import StatusIcon from '@/components/Global/StatusIcon';
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500154
SurenNewareba91c492020-10-27 14:18:54 +0530155import TableRowExpandMixin, {
156 expandRowLabel,
157} from '@/components/Mixins/TableRowExpandMixin';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500158import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700159
160export default {
161 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500162 mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700163 data() {
164 return {
165 fields: [
166 {
167 key: 'expandRow',
168 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500169 tdClass: 'table-row-expand',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700170 },
171 {
172 key: 'id',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530173 label: this.$t('pageInventory.table.id'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500174 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700175 },
176 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530177 key: 'hardwareType',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530178 label: this.$t('pageInventory.table.hardwareType'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500179 formatter: this.dataFormatter,
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530180 tdClass: 'text-nowrap',
181 },
182 {
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700183 key: 'health',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530184 label: this.$t('pageInventory.table.health'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500185 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500186 tdClass: 'text-nowrap',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700187 },
188 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530189 key: 'locationNumber',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530190 label: this.$t('pageInventory.table.locationNumber'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500191 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700192 },
193 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530194 key: 'locationIndicatorActive',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530195 label: this.$t('pageInventory.table.identifyLed'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500196 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500197 },
198 ],
SurenNewareba91c492020-10-27 14:18:54 +0530199 expandRowLabel: expandRowLabel,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700200 };
201 },
202 computed: {
203 systems() {
204 return this.$store.getters['system/systems'];
Derick Montague602e98a2020-10-21 16:20:00 -0500205 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700206 },
207 created() {
208 this.$store.dispatch('system/getSystem').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500209 // Emit initial data fetch complete to parent component
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530210 this.$root.$emit('hardware-status-system-complete');
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700211 });
Derick Montague602e98a2020-10-21 16:20:00 -0500212 },
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530213 methods: {
214 toggleIdentifyLedSwitch(state) {
215 this.$store
216 .dispatch('system/changeIdentifyLedState', state)
217 .catch(({ message }) => this.errorToast(message));
218 },
219 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700220};
221</script>