Add emoji to computer name

This commit is contained in:
Adam Goldsmith 2020-03-10 20:22:23 -04:00
parent 40b8c62346
commit e983d4a157

View File

@ -1,6 +1,9 @@
<template> <template>
<span class="text-content"> <span class="text-content">
<div class="name">{{ name }}</div> <div class="name">
<span class="emoji">{{ emoji }}</span
>{{ name }}
</div>
<div class="hostname">{{ asset.name }}</div> <div class="hostname">{{ asset.name }}</div>
<div class="mac">{{ getCustom('MAC Address') }}</div> <div class="mac">{{ getCustom('MAC Address') }}</div>
<div class="mac">{{ getCustom('MAC Address 2') }}</div> <div class="mac">{{ getCustom('MAC Address 2') }}</div>
@ -17,6 +20,13 @@ import snipeit from './snipeit';
export default class ComputersLabelText extends Vue { export default class ComputersLabelText extends Vue {
@Prop(Object) readonly asset: snipeit.Hardware; @Prop(Object) readonly asset: snipeit.Hardware;
get emoji() {
return this.asset.name.includes('Laptop')
? '💻'
: this.asset.name.includes('Desktop')
? '🖥'
: '?';
}
get name() { get name() {
return numberToWords(this.asset.name.match(/[0-9]+$/)[0]).toUpperCase(); return numberToWords(this.asset.name.match(/[0-9]+$/)[0]).toUpperCase();
} }