summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei YU <yulei.sh@bytedance.com>2021-06-18 14:22:57 +0300
committerDerick Montague <derick.montague@ibm.com>2021-06-23 18:47:10 +0300
commit6641cc489d053d6978868b94ddfb3dc93fd96dde (patch)
tree4197c583775a274f6bb32f9e3bd52d8d6bb4ff25
parent42a270eac2f9f44fd558594b7ca7251c8dc42897 (diff)
downloadwebui-vue-6641cc489d053d6978868b94ddfb3dc93fd96dde.tar.xz
kvm: Disconnect on page unload/refresh
Disconnect the VNC when page is unloaded. Otherwise, it creates a new VNC connection on every page load/refresh, and it causes the KVM failure when it reaches the max connections. Tested: Refresh the KVM page, go to other pages and go back to KVM page, verify the KVM works fine and the connection is closed and re-connected, and verify there is no extra connections. obmc-ikvm[233]: 18/06/2021 10:46:26 Got connection from client 127.0.0.1 obmc-ikvm[233]: 18/06/2021 10:46:26 0 other clients Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: Iffb3cf34a357e247d4b2aabe8dc17080b50c8da4
-rw-r--r--src/views/Control/Kvm/KvmConsole.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/views/Control/Kvm/KvmConsole.vue b/src/views/Control/Kvm/KvmConsole.vue
index d7ec31e0..c028a9fc 100644
--- a/src/views/Control/Kvm/KvmConsole.vue
+++ b/src/views/Control/Kvm/KvmConsole.vue
@@ -94,11 +94,16 @@ export default {
},
beforeDestroy() {
window.removeEventListener('resize', this.resizeKvmWindow);
+ this.closeTerminal();
},
methods: {
sendCtrlAltDel() {
this.rfb.sendCtrlAltDel();
},
+ closeTerminal() {
+ this.rfb.disconnect();
+ this.rfb = null;
+ },
openTerminal() {
const token = this.$store.getters['authentication/token'];
this.rfb = new RFB(