diff options
author | Alexandr Ilenko <AIlenko@IBS.RU> | 2022-08-30 10:50:03 +0300 |
---|---|---|
committer | Alexandr Ilenko <AIlenko@IBS.RU> | 2022-08-30 10:50:03 +0300 |
commit | 53053c00715b33ba83b055cb7c0f6bec629d7689 (patch) | |
tree | 893ae3b39eec0679d41a0cb2136dafa8f0bcfab1 /src/views/_ibs/Operations | |
parent | 0444ab4658743504ddf12ddf911158aebf9037ae (diff) | |
parent | 788f3f3566bea46a164ed8ed68b39f69344fc65e (diff) | |
download | webui-vue-53053c00715b33ba83b055cb7c0f6bec629d7689.tar.xz |
Merge branch 'fix-SILABMC-172' into sila
Diffstat (limited to 'src/views/_ibs/Operations')
-rw-r--r-- | src/views/_ibs/Operations/Kvm/KvmConsole.vue | 8 | ||||
-rw-r--r-- | src/views/_ibs/Operations/SerialOverLan/SerialOverLanConsole.vue | 6 | ||||
-rw-r--r-- | src/views/_ibs/Operations/VirtualMedia/VirtualMedia.vue | 9 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/views/_ibs/Operations/Kvm/KvmConsole.vue b/src/views/_ibs/Operations/Kvm/KvmConsole.vue index c671a4b9..69fce099 100644 --- a/src/views/_ibs/Operations/Kvm/KvmConsole.vue +++ b/src/views/_ibs/Operations/Kvm/KvmConsole.vue @@ -105,12 +105,10 @@ export default { this.rfb = null; }, openTerminal() { + const url = new URL('/kvm/0', window.location.href); + url.protocol = url.protocol.replace('http', 'ws'); const token = this.$store.getters['authentication/token']; - this.rfb = new RFB( - this.$refs.panel, - `wss://${window.location.host}/kvm/0`, - { wsProtocols: [token] } - ); + this.rfb = new RFB(this.$refs.panel, url, { wsProtocols: [token] }); this.rfb.scaleViewport = true; this.rfb.clipViewport = true; diff --git a/src/views/_ibs/Operations/SerialOverLan/SerialOverLanConsole.vue b/src/views/_ibs/Operations/SerialOverLan/SerialOverLanConsole.vue index 6393006a..c05486f8 100644 --- a/src/views/_ibs/Operations/SerialOverLan/SerialOverLanConsole.vue +++ b/src/views/_ibs/Operations/SerialOverLan/SerialOverLanConsole.vue @@ -91,9 +91,9 @@ export default { openTerminal() { const token = this.$store.getters['authentication/token']; - this.ws = new WebSocket(`wss://${window.location.host}/console0`, [ - token, - ]); + const url = new URL('/console0', window.location.href); + url.protocol = url.protocol.replace('http', 'ws'); + this.ws = new WebSocket(url, [token]); // Refer https://github.com/xtermjs/xterm.js/ for xterm implementation and addons. diff --git a/src/views/_ibs/Operations/VirtualMedia/VirtualMedia.vue b/src/views/_ibs/Operations/VirtualMedia/VirtualMedia.vue index bfd87b8a..320f0030 100644 --- a/src/views/_ibs/Operations/VirtualMedia/VirtualMedia.vue +++ b/src/views/_ibs/Operations/VirtualMedia/VirtualMedia.vue @@ -150,12 +150,9 @@ export default { methods: { startVM(device) { const token = this.$store.getters['authentication/token']; - device.nbd = new NbdServer( - `wss://${window.location.host}${device.websocket}`, - device.file, - device.id, - token - ); + const url = new URL(device.websocket, window.location.href); + url.protocol = url.protocol.replace('http', 'ws'); + device.nbd = new NbdServer(url, device.file, device.id, token); device.nbd.socketStarted = () => this.successToast(this.$t('pageVirtualMedia.toast.serverRunning')); device.nbd.errorReadingFile = () => |