summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuyLe <hule@amperecomputing.com>2023-10-09 10:32:28 +0300
committerHuyAnhLe <hule@amperecomputing.com>2023-10-23 05:03:50 +0300
commit5d86af86e5dd0c4c7d9e902fc191c8b19ac890d1 (patch)
tree652d6a914ccab0bb306767bde745969dbd2356c9
parent710f121e5af912e6b622740b9ded43dff69b8f31 (diff)
downloadwebui-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>
-rw-r--r--src/locales/en-US.json1
-rw-r--r--src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue29
2 files changed, 30 insertions, 0 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index 18bb7c6a..ab630757 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -439,6 +439,7 @@
"serviceEnabled": "Service enabled",
"serviceEntryPointUuid": "Service entry point UUID",
"sparePartNumber": "Spare part number",
+ "state": "State",
"statusHealthRollup": "Status (Health rollup)",
"statusState": "Status (State)",
"subModel": "Sub model",
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>