diff options
author | Lei YU <yulei.sh@bytedance.com> | 2021-06-18 14:22:57 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-06-23 18:47:10 +0300 |
commit | 6641cc489d053d6978868b94ddfb3dc93fd96dde (patch) | |
tree | 4197c583775a274f6bb32f9e3bd52d8d6bb4ff25 | |
parent | 42a270eac2f9f44fd558594b7ca7251c8dc42897 (diff) | |
download | webui-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.vue | 5 |
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( |