Skip to content

Commit

Permalink
fix(ui): make version copyable from info box (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Mar 22, 2021
1 parent 6162933 commit 4d79d44
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@

<div class="controller-status">{{ appInfo.controllerStatus }}</div>

<v-tooltip bottom>
<v-tooltip bottom open-on-click>
<template v-slot:activator="{ on }">
<v-icon
dark
medium
style="cursor:default;margin:0 1rem"
color="primary"
v-on="on"
@click="copyVersion"
>info</v-icon
>
</template>
Expand Down Expand Up @@ -301,6 +302,18 @@ export default {
methods: {
...mapActions(['initNodes', 'setAppInfo', 'updateValue', 'removeValue']),
...mapMutations(['setControllerStatus', 'initNode', 'removeNode']),
copyVersion () {
const el = document.createElement('textarea')
el.value = `zwavejs2mqtt: ${this.appInfo.appVersion}\nzwave-js: ${this.appInfo.zwaveVersion}\nhome id: ${this.appInfo.homeid}\n home hex:${this.appInfo.homeHex}`
el.setAttribute('readonly', '')
el.style.position = 'absolute'
el.style.left = '-9999px'
document.body.appendChild(el)
el.select()
document.execCommand('copy')
document.body.removeChild(el)
this.showSnackbar('Copied to clipboard')
},
async updatePassword () {
try {
const response = await ConfigApis.updatePassword(this.password)
Expand Down

0 comments on commit 4d79d44

Please sign in to comment.