Skip to content

Commit

Permalink
fix: make top col responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed May 15, 2024
1 parent 33a32fa commit dd1c2fe
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/views/Zniffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
}"
>
<v-row v-if="zniffer.enabled">
<v-col class="pa-0 pt-2" cols="6">
<v-col
ref="settingCol"
v-resize="onTopColResize"
class="pa-0 pt-2"
cols="6"
>
<v-text-field
v-model="search"
clearable
Expand Down Expand Up @@ -299,10 +304,8 @@ export default {
},
},
watch: {
topPaneHeight(v) {
if (this.scrollWrapper) {
this.scrollWrapper.style.height = `${v - this.offsetTop}px`
}
topPaneHeight() {
this.resizeScrollWrapper()
},
znifferState(state) {
this.frequency = state.frequency ?? null
Expand Down Expand Up @@ -381,15 +384,15 @@ export default {
framesFiltered: [],
headers: [
{ text: 'Timestamp', value: 'timestamp', width: 160 },
{ text: 'Delta [ms]', value: 'delta' },
{ text: 'Delta [ms]', value: 'delta', width: 150 },
{
text: 'Protocol Data Rate',
value: 'protocolDataRate',
width: 180,
},
{ text: 'RSSI', value: 'rssi' },
{ text: 'Ch', value: 'channel' },
{ text: 'Home Id', value: 'homeId' },
{ text: 'RSSI', value: 'rssi', width: 100 },
{ text: 'Ch', value: 'channel', width: 100 },
{ text: 'Home Id', value: 'homeId', width: 100 },
{ text: 'Route', value: 'sourceNodeId' },
{ text: 'Type', value: 'type' },
{ text: 'Payload', value: 'payload' },
Expand All @@ -398,6 +401,17 @@ export default {
},
methods: {
...mapActions(useBaseStore, ['showSnackbar']),
onTopColResize() {
this.offsetTop = this.$refs.settingCol.clientHeight + 20
this.resizeScrollWrapper()
},
resizeScrollWrapper() {
if (this.scrollWrapper) {
this.scrollWrapper.style.height = `${
this.topPaneHeight - this.offsetTop
}px`
}
},
filterFrames(search) {
if (!search || search.trim() === '') {
this.framesFiltered = this.frames
Expand Down

0 comments on commit dd1c2fe

Please sign in to comment.