Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): make version copyable from info box #927

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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