Display DIMM identify LED element only if LED is present
If identify LED for the DIMM module is not present, don't display
control element for it.
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: I30f7e3ad9333874bbeb2050c421baf509bb833fc
diff --git a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
index 6599481..c05ae73 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTableDimmSlot.vue
@@ -53,6 +53,7 @@
<!-- Toggle identify LED -->
<template #cell(identifyLed)="row">
<b-form-checkbox
+ v-if="hasIdentifyLed(row.item.identifyLed)"
v-model="row.item.identifyLed"
name="switch"
switch
@@ -63,6 +64,7 @@
</span>
<span v-else> {{ $t('global.status.off') }} </span>
</b-form-checkbox>
+ <div v-else>--</div>
</template>
<template #row-details="{ item }">
<b-container fluid>
@@ -250,6 +252,9 @@
})
.catch(({ message }) => this.errorToast(message));
},
+ hasIdentifyLed(identifyLed) {
+ return typeof identifyLed === 'boolean';
+ },
},
};
</script>