webapp: Console: better scrolling implementation
This commit is contained in:
parent
f63b7f6ee7
commit
a6f4403417
@ -46,6 +46,16 @@ export default defineComponent({
|
|||||||
unmounted() {
|
unmounted() {
|
||||||
this.closeSocket();
|
this.closeSocket();
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
consoleBuffer() {
|
||||||
|
if (this.isAutoScroll) {
|
||||||
|
let textarea = this.$el.querySelector("#console");
|
||||||
|
setTimeout(() => {
|
||||||
|
textarea.scrollTop = textarea.scrollHeight;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initSocket() {
|
initSocket() {
|
||||||
console.log("Starting connection to WebSocket Server");
|
console.log("Starting connection to WebSocket Server");
|
||||||
@ -61,11 +71,6 @@ export default defineComponent({
|
|||||||
this.socket.onmessage = (event) => {
|
this.socket.onmessage = (event) => {
|
||||||
console.log(event);
|
console.log(event);
|
||||||
this.consoleBuffer += event.data;
|
this.consoleBuffer += event.data;
|
||||||
|
|
||||||
if (this.isAutoScroll) {
|
|
||||||
let textarea = this.$el.querySelector("#console");
|
|
||||||
textarea.scrollTop = textarea.scrollHeight;
|
|
||||||
}
|
|
||||||
this.heartCheck(); // Reset heartbeat detection
|
this.heartCheck(); // Reset heartbeat detection
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user