From 40b8c623461601e525bf18c03395f84f2581b655 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 10 Mar 2020 20:21:03 -0400 Subject: [PATCH] Make MAC Address lookup more generic --- ComputersLabelText.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ComputersLabelText.vue b/ComputersLabelText.vue index ea453c0..05cbbf5 100644 --- a/ComputersLabelText.vue +++ b/ComputersLabelText.vue @@ -2,8 +2,8 @@
{{ name }}
{{ asset.name }}
-
{{ mac }}
-
{{ mac2 }}
+
{{ getCustom('MAC Address') }}
+
{{ getCustom('MAC Address 2') }}
@@ -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; } }