修复运维中心中开启历史日志后再开启实时日志连接失败
This commit is contained in:
@@ -32,6 +32,7 @@ export default {
|
||||
filter: "",
|
||||
logData: "",
|
||||
websocket: null,
|
||||
destroyedCallback: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -61,7 +62,9 @@ export default {
|
||||
},
|
||||
destroyed() {
|
||||
console.log('destroyed');
|
||||
window.websocket.close();
|
||||
if (this.destroyedCallback) {
|
||||
this.destroyedCallback()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData: function () {
|
||||
@@ -101,6 +104,9 @@ export default {
|
||||
}
|
||||
window.websocket.onopen = e => {
|
||||
console.log(`conn open: ${e}`);
|
||||
this.destroyedCallback = ()=>{
|
||||
window.websocket.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,8 +18,8 @@ export default {
|
||||
winHeight: window.innerHeight - 220,
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
console.log("removeUrl11 == " + this.removeUrl)
|
||||
},
|
||||
methods: {
|
||||
getURl: function () {
|
||||
|
||||
Reference in New Issue
Block a user