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

feat: add node debug info tab #462

Merged
merged 4 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"@mdi/font": "^5.9.55",
ahochsteger marked this conversation as resolved.
Show resolved Hide resolved
"@zwave-js/server": "^1.0.0-beta.4",
"ansi_up": "^5.0.0",
"app-root-path": "^3.0.0",
Expand Down
27 changes: 27 additions & 0 deletions src/components/nodes-table/ExpandedNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<v-tab key="node">Node</v-tab>
<v-tab v-if="showHass" key="homeassistant">Home Assistant</v-tab>
<v-tab key="groups">Groups</v-tab>
<v-tab key="debug">Debug Info</v-tab>

<!-- TABS -->
<v-tabs-items
style="background: transparent; padding-bottom: 10px;"
Expand All @@ -29,6 +31,19 @@
<v-tab-item key="groups">
<association-groups :node="node" :nodes="nodes" :socket="socket" />
</v-tab-item>

<!-- TAB DEBUG INFO -->
<v-tab-item key="debug">
<v-textarea
class="mx-2"
rows="10"
append-icon="mdi-content-copy"
ahochsteger marked this conversation as resolved.
Show resolved Hide resolved
v-model="nodeJson"
readonly
ref="nodeJsonContent"
@click:append="copyText"
></v-textarea>
</v-tab-item>
</v-tabs-items>
</v-tabs>
</td>
Expand Down Expand Up @@ -57,6 +72,9 @@ export default {
},
computed: {
...mapGetters(['gateway']),
nodeJson () {
return JSON.stringify(this.node, null, 2)
},
showHass () {
console.log(Object.keys(this.node.hassDevices))
return (
Expand All @@ -70,6 +88,15 @@ export default {
return {
currentTab: 0
}
},
methods: {
copyText () {
const textToCopy = this.$refs.nodeJsonContent.$el.querySelector(
'textarea'
)
textToCopy.select()
document.execCommand('copy')
}
}
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css' // Ensure you are using css-loader
import '@mdi/font/css/materialdesignicons.css' // Ensure you are using css-loader
ahochsteger marked this conversation as resolved.
Show resolved Hide resolved

Vue.use(Vuetify)

Expand Down