mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Fix websocket for #384
This commit is contained in:
parent
a0b6eed037
commit
84958502b1
@ -4,7 +4,8 @@
|
|||||||
<b-container class="pt-4">
|
<b-container class="pt-4">
|
||||||
<b-alert show dismissible variant="info">
|
<b-alert show dismissible variant="info">
|
||||||
This is a beta version of sist2-admin. Please submit bug reports, usability issues and feature requests
|
This is a beta version of sist2-admin. Please submit bug reports, usability issues and feature requests
|
||||||
to the <a href="https://github.com/simon987/sist2/issues/new/choose" target="_blank">issue tracker on Github</a>. Thank you!
|
to the <a href="https://github.com/simon987/sist2/issues/new/choose" target="_blank">issue tracker on
|
||||||
|
Github</a>. Thank you!
|
||||||
</b-alert>
|
</b-alert>
|
||||||
<router-view/>
|
<router-view/>
|
||||||
</b-container>
|
</b-container>
|
||||||
@ -31,7 +32,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
connectNotifications() {
|
connectNotifications() {
|
||||||
|
if (window.location.protocol === "https:") {
|
||||||
|
this.socket = new WebSocket(`wss://${window.location.host}/notifications`);
|
||||||
|
} else {
|
||||||
this.socket = new WebSocket(`ws://${window.location.host}/notifications`);
|
this.socket = new WebSocket(`ws://${window.location.host}/notifications`);
|
||||||
|
}
|
||||||
this.socket.onopen = () => {
|
this.socket.onopen = () => {
|
||||||
this.socket.send("Hello from client");
|
this.socket.send("Hello from client");
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const n = this.mode === "follow" ? 32 : 9999999999;
|
const n = this.mode === "follow" ? 32 : 9999999999;
|
||||||
|
if (window.location.protocol === "https:") {
|
||||||
|
this.socket = new WebSocket(`wss://${window.location.host}/log/${this.taskId}?n=${n}`);
|
||||||
|
} else {
|
||||||
this.socket = new WebSocket(`ws://${window.location.host}/log/${this.taskId}?n=${n}`);
|
this.socket = new WebSocket(`ws://${window.location.host}/log/${this.taskId}?n=${n}`);
|
||||||
|
}
|
||||||
this.socket.onopen = () => {
|
this.socket.onopen = () => {
|
||||||
this.socket.send("Hello from client");
|
this.socket.send("Hello from client");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user