Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 1 | <template> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 2 | <page-section :section-title="$t('pageInventory.dimmSlot')"> |
SurenNeware | 787635a | 2020-11-24 22:42:42 +0530 | [diff] [blame] | 3 | <b-row class="align-items-end"> |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 4 | <b-col sm="6" md="5" xl="4"> |
Dixsie Wolmers | 9b22b49 | 2020-09-07 21:26:06 -0500 | [diff] [blame] | 5 | <search |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 6 | @change-search="onChangeSearchInput" |
| 7 | @clear-search="onClearSearchInput" |
Dixsie Wolmers | 9b22b49 | 2020-09-07 21:26:06 -0500 | [diff] [blame] | 8 | /> |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 9 | </b-col> |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 10 | <b-col sm="6" md="3" xl="2"> |
| 11 | <table-cell-count |
| 12 | :filtered-items-count="filteredRows" |
| 13 | :total-number-of-cells="dimms.length" |
| 14 | ></table-cell-count> |
| 15 | </b-col> |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 16 | </b-row> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 17 | <b-table |
| 18 | sort-icon-left |
| 19 | no-sort-reset |
Sukanya Pandey | fde429e | 2020-09-14 20:48:39 +0530 | [diff] [blame] | 20 | hover |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 21 | sort-by="health" |
SurenNeware | 5e25e28 | 2020-07-08 15:57:23 +0530 | [diff] [blame] | 22 | responsive="md" |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 23 | show-empty |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 24 | :items="dimms" |
| 25 | :fields="fields" |
| 26 | :sort-desc="true" |
| 27 | :sort-compare="sortCompare" |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 28 | :filter="searchFilter" |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 29 | :empty-text="$t('global.table.emptyMessage')" |
SurenNeware | 156a0e6 | 2020-08-28 19:20:03 +0530 | [diff] [blame] | 30 | :empty-filtered-text="$t('global.table.emptySearchMessage')" |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 31 | :busy="isBusy" |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 32 | @filtered="onFiltered" |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 33 | > |
| 34 | <!-- Expand chevron icon --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 35 | <template #cell(expandRow)="row"> |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 36 | <b-button |
| 37 | variant="link" |
| 38 | data-test-id="hardwareStatus-button-expandDimms" |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 39 | :title="expandRowLabel" |
| 40 | class="btn-icon-only" |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 41 | @click="toggleRowDetails(row)" |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 42 | > |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 43 | <icon-chevron /> |
SurenNeware | 6e2cb97 | 2020-12-24 20:58:16 +0530 | [diff] [blame] | 44 | <span class="sr-only">{{ expandRowLabel }}</span> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 45 | </b-button> |
| 46 | </template> |
| 47 | |
| 48 | <!-- Health --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 49 | <template #cell(health)="{ value }"> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 50 | <status-icon :status="statusIcon(value)" /> |
| 51 | {{ value }} |
| 52 | </template> |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 53 | |
| 54 | <!-- StatusState --> |
| 55 | <template #cell(statusState)="{ value }"> |
| 56 | <status-icon :status="statusStateIcon(value)" /> |
| 57 | {{ value }} |
| 58 | </template> |
| 59 | |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 60 | <!-- Toggle identify LED --> |
| 61 | <template #cell(identifyLed)="row"> |
| 62 | <b-form-checkbox |
Konstantin Aladyshev | b24a483 | 2022-11-02 17:32:04 +0300 | [diff] [blame] | 63 | v-if="hasIdentifyLed(row.item.identifyLed)" |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 64 | v-model="row.item.identifyLed" |
| 65 | name="switch" |
| 66 | switch |
| 67 | @change="toggleIdentifyLedValue(row.item)" |
| 68 | > |
| 69 | <span v-if="row.item.identifyLed"> |
| 70 | {{ $t('global.status.on') }} |
| 71 | </span> |
| 72 | <span v-else> {{ $t('global.status.off') }} </span> |
| 73 | </b-form-checkbox> |
Konstantin Aladyshev | b24a483 | 2022-11-02 17:32:04 +0300 | [diff] [blame] | 74 | <div v-else>--</div> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 75 | </template> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 76 | <template #row-details="{ item }"> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 77 | <b-container fluid> |
| 78 | <b-row> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 79 | <b-col sm="6" xl="6"> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 80 | <dl> |
Jason M. Bills | af76e2b | 2023-06-15 08:20:34 -0700 | [diff] [blame] | 81 | <!-- Manufacturer --> |
| 82 | <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt> |
| 83 | <dd>{{ dataFormatter(item.manufacturer) }}</dd> |
| 84 | </dl> |
| 85 | <dl> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 86 | <!-- Part Number --> |
| 87 | <dt>{{ $t('pageInventory.table.partNumber') }}:</dt> |
| 88 | <dd>{{ dataFormatter(item.partNumber) }}</dd> |
| 89 | </dl> |
| 90 | <dl> |
| 91 | <!-- Serial Number --> |
| 92 | <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt> |
| 93 | <dd>{{ dataFormatter(item.serialNumber) }}</dd> |
| 94 | </dl> |
| 95 | <dl> |
| 96 | <!-- Spare Part Number --> |
| 97 | <dt>{{ $t('pageInventory.table.sparePartNumber') }}:</dt> |
| 98 | <dd>{{ dataFormatter(item.sparePartNumber) }}</dd> |
| 99 | </dl> |
| 100 | <dl> |
| 101 | <!-- Model --> |
| 102 | <dt>{{ $t('pageInventory.table.model') }}:</dt> |
| 103 | <dd>{{ dataFormatter(item.model) }}</dd> |
| 104 | </dl> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 105 | </b-col> |
| 106 | <b-col sm="6" xl="6"> |
| 107 | <dl> |
Glukhov Mikhail | ba60e9c | 2022-11-21 10:21:51 +0300 | [diff] [blame] | 108 | <!-- Capacity MiB --> |
| 109 | <dt>{{ $t('pageInventory.table.capacityMiB') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 110 | <dd> |
| 111 | {{ dataFormatter(item.capacityMiB) }} |
| 112 | {{ $t('unit.MiB') }} |
| 113 | </dd> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 114 | </dl> |
| 115 | <dl> |
Jason M. Bills | af76e2b | 2023-06-15 08:20:34 -0700 | [diff] [blame] | 116 | <!-- Rank Count --> |
| 117 | <dt>{{ $t('pageInventory.table.rankCount') }}:</dt> |
| 118 | <dd>{{ dataFormatter(item.rankCount) }}</dd> |
| 119 | </dl> |
| 120 | <dl> |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 121 | <!-- Status--> |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 122 | <dt>{{ $t('pageInventory.table.statusState') }}:</dt> |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 123 | <dd>{{ dataFormatter(item.statusState) }}</dd> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 124 | </dl> |
Sandeepa Singh | 61fdd94 | 2021-12-27 17:40:32 +0530 | [diff] [blame] | 125 | <dl> |
| 126 | <!-- Enabled--> |
| 127 | <dt>{{ $t('pageInventory.table.enabled') }}:</dt> |
| 128 | <dd>{{ dataFormatter(item.enabled) }}</dd> |
| 129 | </dl> |
| 130 | </b-col> |
| 131 | </b-row> |
| 132 | <div class="section-divider mb-3 mt-3"></div> |
| 133 | <b-row> |
| 134 | <b-col sm="6" xl="6"> |
| 135 | <dl> |
| 136 | <!-- Description --> |
| 137 | <dt>{{ $t('pageInventory.table.description') }}:</dt> |
| 138 | <dd>{{ dataFormatter(item.description) }}</dd> |
| 139 | </dl> |
| 140 | <dl> |
| 141 | <!-- Memory Type --> |
| 142 | <dt>{{ $t('pageInventory.table.memoryType') }}:</dt> |
| 143 | <dd>{{ dataFormatter(item.memoryType) }}</dd> |
| 144 | </dl> |
| 145 | <dl> |
| 146 | <!-- Base Module Type --> |
| 147 | <dt>{{ $t('pageInventory.table.baseModuleType') }}:</dt> |
| 148 | <dd>{{ dataFormatter(item.baseModuleType) }}</dd> |
| 149 | </dl> |
Sandeepa Singh | 61fdd94 | 2021-12-27 17:40:32 +0530 | [diff] [blame] | 150 | </b-col> |
| 151 | <b-col sm="6" xl="6"> |
| 152 | <dl> |
| 153 | <!-- Bus Width Bits --> |
| 154 | <dt>{{ $t('pageInventory.table.busWidthBits') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 155 | <dd> |
| 156 | {{ dataFormatter(item.busWidthBits) }} |
| 157 | {{ $t('unit.bit') }} |
| 158 | </dd> |
Sandeepa Singh | 61fdd94 | 2021-12-27 17:40:32 +0530 | [diff] [blame] | 159 | </dl> |
| 160 | <dl> |
| 161 | <!-- Data Width Bits --> |
| 162 | <dt>{{ $t('pageInventory.table.dataWidthBits') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 163 | <dd> |
| 164 | {{ dataFormatter(item.dataWidthBits) }} |
| 165 | {{ $t('unit.bit') }} |
| 166 | </dd> |
Sandeepa Singh | 61fdd94 | 2021-12-27 17:40:32 +0530 | [diff] [blame] | 167 | </dl> |
| 168 | <dl> |
| 169 | <!-- Operating Speed Mhz --> |
| 170 | <dt>{{ $t('pageInventory.table.operatingSpeedMhz') }}:</dt> |
Glukhov Mikhail | d0b078f | 2022-12-24 12:16:53 +0300 | [diff] [blame] | 171 | <dd> |
| 172 | {{ dataFormatter(item.operatingSpeedMhz) }} |
| 173 | {{ $t('unit.MHz') }} |
| 174 | </dd> |
Sandeepa Singh | 61fdd94 | 2021-12-27 17:40:32 +0530 | [diff] [blame] | 175 | </dl> |
Jason M. Bills | af76e2b | 2023-06-15 08:20:34 -0700 | [diff] [blame] | 176 | <dl> |
| 177 | <!-- Error Correction --> |
| 178 | <dt>{{ $t('pageInventory.table.errorCorrection') }}:</dt> |
| 179 | <dd>{{ dataFormatter(item.errorCorrection) }}</dd> |
| 180 | </dl> |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 181 | </b-col> |
| 182 | </b-row> |
| 183 | </b-container> |
| 184 | </template> |
| 185 | </b-table> |
| 186 | </page-section> |
| 187 | </template> |
| 188 | |
| 189 | <script> |
| 190 | import PageSection from '@/components/Global/PageSection'; |
| 191 | import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; |
| 192 | |
| 193 | import StatusIcon from '@/components/Global/StatusIcon'; |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 194 | import TableCellCount from '@/components/Global/TableCellCount'; |
| 195 | |
Nikhil Ashoka | f11a190 | 2024-05-09 15:17:44 +0530 | [diff] [blame] | 196 | import BVToastMixin from '@/components/Mixins/BVToastMixin'; |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 197 | import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 198 | import TableSortMixin from '@/components/Mixins/TableSortMixin'; |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 199 | import Search from '@/components/Global/Search'; |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 200 | import SearchFilterMixin, { |
| 201 | searchFilter, |
| 202 | } from '@/components/Mixins/SearchFilterMixin'; |
| 203 | import TableRowExpandMixin, { |
| 204 | expandRowLabel, |
| 205 | } from '@/components/Mixins/TableRowExpandMixin'; |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 206 | import { useI18n } from 'vue-i18n'; |
| 207 | import i18n from '@/i18n'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 208 | |
| 209 | export default { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 210 | components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount }, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 211 | mixins: [ |
Nikhil Ashoka | f11a190 | 2024-05-09 15:17:44 +0530 | [diff] [blame] | 212 | BVToastMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 213 | TableRowExpandMixin, |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 214 | DataFormatterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 215 | TableSortMixin, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 216 | SearchFilterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 217 | ], |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 218 | data() { |
| 219 | return { |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 220 | $t: useI18n().t, |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 221 | isBusy: true, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 222 | fields: [ |
| 223 | { |
| 224 | key: 'expandRow', |
| 225 | label: '', |
| 226 | tdClass: 'table-row-expand', |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 227 | }, |
| 228 | { |
| 229 | key: 'id', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 230 | label: i18n.global.t('pageInventory.table.id'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 231 | formatter: this.dataFormatter, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 232 | }, |
| 233 | { |
| 234 | key: 'health', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 235 | label: i18n.global.t('pageInventory.table.health'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 236 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 237 | tdClass: 'text-nowrap', |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 238 | }, |
| 239 | { |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 240 | key: 'statusState', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 241 | label: i18n.global.t('pageInventory.table.state'), |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 242 | formatter: this.dataFormatter, |
| 243 | tdClass: 'text-nowrap', |
| 244 | }, |
| 245 | { |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 246 | key: 'locationNumber', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 247 | label: i18n.global.t('pageInventory.table.locationNumber'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 248 | formatter: this.dataFormatter, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 249 | }, |
| 250 | { |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 251 | key: 'identifyLed', |
Surya V | de23ea2 | 2024-07-11 15:19:46 +0530 | [diff] [blame^] | 252 | label: i18n.global.t('pageInventory.table.identifyLed'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 253 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 254 | }, |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 255 | ], |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 256 | searchFilter: searchFilter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 257 | searchTotalFilteredRows: 0, |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 258 | expandRowLabel: expandRowLabel, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 259 | }; |
| 260 | }, |
| 261 | computed: { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 262 | filteredRows() { |
| 263 | return this.searchFilter |
| 264 | ? this.searchTotalFilteredRows |
| 265 | : this.dimms.length; |
| 266 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 267 | dimms() { |
| 268 | return this.$store.getters['memory/dimms']; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 269 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 270 | }, |
| 271 | created() { |
| 272 | this.$store.dispatch('memory/getDimms').finally(() => { |
Gunnar Mills | defc9e2 | 2020-07-07 20:29:03 -0500 | [diff] [blame] | 273 | // Emit initial data fetch complete to parent component |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 274 | this.$root.$emit('hardware-status-dimm-slot-complete'); |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 275 | this.isBusy = false; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 276 | }); |
| 277 | }, |
| 278 | methods: { |
| 279 | sortCompare(a, b, key) { |
| 280 | if (key === 'health') { |
| 281 | return this.sortStatus(a, b, key); |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 282 | } else if (key === 'statusState') { |
| 283 | return this.sortStatusState(a, b, key); |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 284 | } |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 285 | }, |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 286 | onFiltered(filteredItems) { |
| 287 | this.searchTotalFilteredRows = filteredItems.length; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 288 | }, |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 289 | toggleIdentifyLedValue(row) { |
| 290 | this.$store |
| 291 | .dispatch('memory/updateIdentifyLedValue', { |
| 292 | uri: row.uri, |
| 293 | identifyLed: row.identifyLed, |
| 294 | }) |
Nikhil Ashoka | f11a190 | 2024-05-09 15:17:44 +0530 | [diff] [blame] | 295 | .then((message) => this.successToast(message)) |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 296 | .catch(({ message }) => this.errorToast(message)); |
| 297 | }, |
Konstantin Aladyshev | b24a483 | 2022-11-02 17:32:04 +0300 | [diff] [blame] | 298 | hasIdentifyLed(identifyLed) { |
| 299 | return typeof identifyLed === 'boolean'; |
| 300 | }, |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 301 | statusStateIcon(status) { |
| 302 | switch (status) { |
| 303 | case 'Enabled': |
| 304 | return 'success'; |
| 305 | case 'Absent': |
| 306 | return 'warning'; |
| 307 | default: |
| 308 | return ''; |
| 309 | } |
| 310 | }, |
| 311 | sortStatusState(a, b, key) { |
| 312 | const statusState = ['Enabled', 'Absent']; |
| 313 | return statusState.indexOf(a[key]) - statusState.indexOf(b[key]); |
| 314 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 315 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 316 | }; |
| 317 | </script> |