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'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 206 | |
| 207 | export default { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 208 | components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount }, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 209 | mixins: [ |
Nikhil Ashoka | f11a190 | 2024-05-09 15:17:44 +0530 | [diff] [blame] | 210 | BVToastMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 211 | TableRowExpandMixin, |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 212 | DataFormatterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 213 | TableSortMixin, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 214 | SearchFilterMixin, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 215 | ], |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 216 | data() { |
| 217 | return { |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 218 | isBusy: true, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 219 | fields: [ |
| 220 | { |
| 221 | key: 'expandRow', |
| 222 | label: '', |
| 223 | tdClass: 'table-row-expand', |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 224 | }, |
| 225 | { |
| 226 | key: 'id', |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 227 | label: this.$t('pageInventory.table.id'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 228 | formatter: this.dataFormatter, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 229 | }, |
| 230 | { |
| 231 | key: 'health', |
Sandeepa Singh | 7affc52 | 2021-07-06 16:29:10 +0530 | [diff] [blame] | 232 | label: this.$t('pageInventory.table.health'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 233 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 234 | tdClass: 'text-nowrap', |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 235 | }, |
| 236 | { |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 237 | key: 'statusState', |
| 238 | label: this.$t('pageInventory.table.state'), |
| 239 | formatter: this.dataFormatter, |
| 240 | tdClass: 'text-nowrap', |
| 241 | }, |
| 242 | { |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 243 | key: 'locationNumber', |
| 244 | label: this.$t('pageInventory.table.locationNumber'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 245 | formatter: this.dataFormatter, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 246 | }, |
| 247 | { |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 248 | key: 'identifyLed', |
| 249 | label: this.$t('pageInventory.table.identifyLed'), |
Dixsie Wolmers | 9726f9a | 2021-09-07 15:33:16 -0500 | [diff] [blame] | 250 | formatter: this.dataFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 251 | }, |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 252 | ], |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 253 | searchFilter: searchFilter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 254 | searchTotalFilteredRows: 0, |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 255 | expandRowLabel: expandRowLabel, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 256 | }; |
| 257 | }, |
| 258 | computed: { |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 259 | filteredRows() { |
| 260 | return this.searchFilter |
| 261 | ? this.searchTotalFilteredRows |
| 262 | : this.dimms.length; |
| 263 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 264 | dimms() { |
| 265 | return this.$store.getters['memory/dimms']; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 266 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 267 | }, |
| 268 | created() { |
| 269 | this.$store.dispatch('memory/getDimms').finally(() => { |
Gunnar Mills | defc9e2 | 2020-07-07 20:29:03 -0500 | [diff] [blame] | 270 | // Emit initial data fetch complete to parent component |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 271 | this.$root.$emit('hardware-status-dimm-slot-complete'); |
Kenneth Fullbright | 4105785 | 2021-12-27 16:19:37 -0600 | [diff] [blame] | 272 | this.isBusy = false; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 273 | }); |
| 274 | }, |
| 275 | methods: { |
| 276 | sortCompare(a, b, key) { |
| 277 | if (key === 'health') { |
| 278 | return this.sortStatus(a, b, key); |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 279 | } else if (key === 'statusState') { |
| 280 | return this.sortStatusState(a, b, key); |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 281 | } |
Yoshie Muranaka | 4177014 | 2020-06-18 14:00:55 -0700 | [diff] [blame] | 282 | }, |
Sukanya Pandey | 9901096 | 2020-07-27 21:44:47 +0530 | [diff] [blame] | 283 | onFiltered(filteredItems) { |
| 284 | this.searchTotalFilteredRows = filteredItems.length; |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 285 | }, |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 286 | toggleIdentifyLedValue(row) { |
| 287 | this.$store |
| 288 | .dispatch('memory/updateIdentifyLedValue', { |
| 289 | uri: row.uri, |
| 290 | identifyLed: row.identifyLed, |
| 291 | }) |
Nikhil Ashoka | f11a190 | 2024-05-09 15:17:44 +0530 | [diff] [blame] | 292 | .then((message) => this.successToast(message)) |
Sandeepa Singh | 8187678 | 2021-09-27 14:52:38 +0530 | [diff] [blame] | 293 | .catch(({ message }) => this.errorToast(message)); |
| 294 | }, |
Konstantin Aladyshev | b24a483 | 2022-11-02 17:32:04 +0300 | [diff] [blame] | 295 | hasIdentifyLed(identifyLed) { |
| 296 | return typeof identifyLed === 'boolean'; |
| 297 | }, |
HuyLe | 5d86af8 | 2023-10-09 14:32:28 +0700 | [diff] [blame] | 298 | statusStateIcon(status) { |
| 299 | switch (status) { |
| 300 | case 'Enabled': |
| 301 | return 'success'; |
| 302 | case 'Absent': |
| 303 | return 'warning'; |
| 304 | default: |
| 305 | return ''; |
| 306 | } |
| 307 | }, |
| 308 | sortStatusState(a, b, key) { |
| 309 | const statusState = ['Enabled', 'Absent']; |
| 310 | return statusState.indexOf(a[key]) - statusState.indexOf(b[key]); |
| 311 | }, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 312 | }, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 313 | }; |
| 314 | </script> |