forked from platypush/platypush
[UI] A friendlier representation of an integration's name.
This commit is contained in:
parent
0aecb50590
commit
a3643c285e
4 changed files with 34 additions and 5 deletions
|
@ -4,6 +4,7 @@ import Clipboard from "@/utils/Clipboard";
|
||||||
import Cookies from "@/utils/Cookies";
|
import Cookies from "@/utils/Cookies";
|
||||||
import DateTime from "@/utils/DateTime";
|
import DateTime from "@/utils/DateTime";
|
||||||
import Events from "@/utils/Events";
|
import Events from "@/utils/Events";
|
||||||
|
import Integrations from "@/utils/Integrations";
|
||||||
import Notification from "@/utils/Notification";
|
import Notification from "@/utils/Notification";
|
||||||
import Screen from "@/utils/Screen";
|
import Screen from "@/utils/Screen";
|
||||||
import Text from "@/utils/Text";
|
import Text from "@/utils/Text";
|
||||||
|
@ -18,6 +19,7 @@ export default {
|
||||||
DateTime,
|
DateTime,
|
||||||
Events,
|
Events,
|
||||||
Notification,
|
Notification,
|
||||||
|
Integrations,
|
||||||
Screen,
|
Screen,
|
||||||
Text,
|
Text,
|
||||||
Types,
|
Types,
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<img :src="icons[name].imgUrl" v-else-if="icons[name]?.imgUrl" alt="name"/>
|
<img :src="icons[name].imgUrl" v-else-if="icons[name]?.imgUrl" alt="name"/>
|
||||||
<i class="fas fa-puzzle-piece" v-else />
|
<i class="fas fa-puzzle-piece" v-else />
|
||||||
</span>
|
</span>
|
||||||
<span class="name" v-if="!collapsed" v-text="name == 'entities' ? 'Home' : name" />
|
<span class="name" v-if="!collapsed" v-text="displayName(name)" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -112,6 +112,15 @@ export default {
|
||||||
this.$emit('select', name)
|
this.$emit('select', name)
|
||||||
this.collapsed = this.isMobile() ? true : this.collapsedDefault
|
this.collapsed = this.isMobile() ? true : this.collapsedDefault
|
||||||
},
|
},
|
||||||
|
|
||||||
|
displayName(name) {
|
||||||
|
if (name === 'entities')
|
||||||
|
return 'Home'
|
||||||
|
if (name === 'execute')
|
||||||
|
return 'Execute'
|
||||||
|
|
||||||
|
return name
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -256,9 +265,9 @@ nav {
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|
||||||
& img {
|
& img, i {
|
||||||
width: 1.25em;
|
width: 1.5em;
|
||||||
height: 1.25em;
|
height: 1.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="section center">
|
<span class="section center">
|
||||||
<div class="title" v-text="group.name" />
|
<div class="title" v-text="pluginDisplayName(group.name)" />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="section right">
|
<span class="section right">
|
||||||
|
|
18
platypush/backend/http/webapp/src/utils/Integrations.vue
Normal file
18
platypush/backend/http/webapp/src/utils/Integrations.vue
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Integrations",
|
||||||
|
methods: {
|
||||||
|
pluginDisplayName(name) {
|
||||||
|
const words = name.split('.')
|
||||||
|
words.forEach((word, idx) => {
|
||||||
|
words[idx] = word.charAt(0).toUpperCase() + word.slice(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (words.length > 1)
|
||||||
|
words[0] = `[${words[0]}]`
|
||||||
|
|
||||||
|
return words.join(' ')
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in a new issue