diff options
author | HuyLe <hule@amperecomputing.com> | 2023-10-09 10:32:28 +0300 |
---|---|---|
committer | HuyAnhLe <hule@amperecomputing.com> | 2023-10-23 05:03:50 +0300 |
commit | 5d86af86e5dd0c4c7d9e902fc191c8b19ac890d1 (patch) | |
tree | 652d6a914ccab0bb306767bde745969dbd2356c9 /src/views/HardwareStatus/Inventory | |
parent | 710f121e5af912e6b622740b9ded43dff69b8f31 (diff) | |
download | webui-vue-5d86af86e5dd0c4c7d9e902fc191c8b19ac890d1.tar.xz |
Add State to DIMM slot inventory summary
Add state information in DIMM slot inventory summary so that users can
know if the DIMM slot has DIMM plugged or not.
Change-Id: Id9b7ebb2079762b354b418d060d4a1223273b50d
Signed-off-by: HuyLe <hule@amperecomputing.com>
Diffstat (limited to 'src/views/HardwareStatus/Inventory')
-rw-r--r-- | src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue index 196335ef..6aa1578f 100644 --- a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue +++ b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue @@ -50,6 +50,13 @@ <status-icon :status="statusIcon(value)" /> {{ value }} </template> + + <!-- StatusState --> + <template #cell(statusState)="{ value }"> + <status-icon :status="statusStateIcon(value)" /> + {{ value }} + </template> + <!-- Toggle identify LED --> <template #cell(identifyLed)="row"> <b-form-checkbox @@ -225,6 +232,12 @@ export default { tdClass: 'text-nowrap', }, { + key: 'statusState', + label: this.$t('pageInventory.table.state'), + formatter: this.dataFormatter, + tdClass: 'text-nowrap', + }, + { key: 'locationNumber', label: this.$t('pageInventory.table.locationNumber'), formatter: this.dataFormatter, @@ -261,6 +274,8 @@ export default { sortCompare(a, b, key) { if (key === 'health') { return this.sortStatus(a, b, key); + } else if (key === 'statusState') { + return this.sortStatusState(a, b, key); } }, onFiltered(filteredItems) { @@ -277,6 +292,20 @@ export default { hasIdentifyLed(identifyLed) { return typeof identifyLed === 'boolean'; }, + statusStateIcon(status) { + switch (status) { + case 'Enabled': + return 'success'; + case 'Absent': + return 'warning'; + default: + return ''; + } + }, + sortStatusState(a, b, key) { + const statusState = ['Enabled', 'Absent']; + return statusState.indexOf(a[key]) - statusState.indexOf(b[key]); + }, }, }; </script> |