Files
speckle-server/packages/frontend/src/cleanup/components/common/SourceAppAvatar.vue
T
Dimitrie Stefanescu ebbabdd34e feat(frontend): various many things 😅
specifically, 1) attempts improvement of the navbar info display in the viewer, 2) makes the object
exploer a bit more friendly, clickable and readable (hopefully!), 3) moves selection info as an
overlay on the viewer, 4) fixes nasty bug in add overlay dialog, 5) adds back some nice props jedd
wanted, etc. thx @izzylis, @clairekuang, @teocomi, @bimgeek & other specklers for the feedback!

re #553 & more
2022-01-30 12:05:28 +00:00

65 lines
2.1 KiB
Vue

<template>
<v-chip
v-tooltip="`Source Application: ${applicationName ? applicationName : 'unknown'}`"
small
class="ma-1 caption white--text no-hover"
:color="color"
>
{{ shortName }}
</v-chip>
</template>
<script>
export default {
props: {
applicationName: {
type: String,
default: '?'
}
},
computed: {
// adding new colors?
// this can help: https://codepen.io/teocomi/pen/vYxvREG?editors=1010
color() {
if (!this.applicationName) return 'grey'
let appname = this.applicationName.toLowerCase()
if (appname.includes('dynamo')) return 'purple'
if (appname.includes('revit')) return 'blue darken-3'
if (appname.includes('autocad')) return 'red lighten-1'
if (appname.includes('civil')) return 'blue lighten-1'
if (appname.includes('blender')) return 'orange darken-1'
if (appname.includes('rhino')) return 'black'
if (appname.includes('grasshopper')) return 'green darken-2'
if (appname.includes('excel')) return 'green lighten-1'
if (appname.includes('unity')) return 'teal'
if (appname.includes('unreal')) return 'brown'
if (appname.includes('python')) return 'yellow darken-1'
if (appname.includes('.net')) return 'purple darken-2'
if (appname.includes('ifc')) return 'red darken-4'
return 'grey'
},
shortName() {
if (!this.applicationName) return '?'
let appname = this.applicationName.toLowerCase()
if (appname.includes('dynamo')) return 'DYN'
if (appname.includes('revit')) return 'RVT'
if (appname.includes('autocad')) return 'ACAD'
if (appname.includes('civil')) return 'C3D'
if (appname.includes('blender')) return 'BLNDR'
if (appname.includes('rhino')) return 'RH'
if (appname.includes('grasshopper')) return 'GH'
if (appname.includes('excel')) return 'XLSX'
if (appname.includes('unity')) return 'UNITY'
if (appname.includes('unreal')) return 'UE'
if (appname.includes('python')) return 'PY'
if (appname.includes('.net')) return '.NET'
if (appname.includes('ifc')) return 'IFC'
return appname
}
}
}
</script>