Make MAC Address lookup more generic

This commit is contained in:
Adam Goldsmith 2020-03-10 20:21:03 -04:00
parent f3de43c8be
commit 40b8c62346

View File

@ -2,8 +2,8 @@
<span class="text-content">
<div class="name">{{ name }}</div>
<div class="hostname">{{ asset.name }}</div>
<div class="mac">{{ mac }}</div>
<div class="mac">{{ mac2 }}</div>
<div class="mac">{{ getCustom('MAC Address') }}</div>
<div class="mac">{{ getCustom('MAC Address 2') }}</div>
</span>
</template>
@ -21,11 +21,8 @@ export default class ComputersLabelText extends Vue {
return numberToWords(this.asset.name.match(/[0-9]+$/)[0]).toUpperCase();
}
get mac() {
return this.asset.custom_fields['MAC Address']?.value;
}
get mac2() {
return this.asset.custom_fields['MAC Address 2']?.value;
getCustom(field) {
return this.asset.custom_fields[field]?.value;
}
}
</script>