use websocket to check for oml
This commit is contained in:
parent
ad5f6a584e
commit
2c5f9823f2
1 changed files with 10 additions and 5 deletions
|
@ -1,10 +1,15 @@
|
||||||
function load() {
|
function load() {
|
||||||
var base = 'http://[::1]:9842',
|
var base = '//[::1]:9842',
|
||||||
img = new Image();
|
ws = new WebSocket('ws:' + base + '/ws');
|
||||||
img.onload = function(event) {
|
ws.onopen = function(event) {
|
||||||
document.location.href = base;
|
document.location.href = 'http:' + base;
|
||||||
|
};
|
||||||
|
ws.onerror = function(event) {
|
||||||
|
ws.close();
|
||||||
|
};
|
||||||
|
ws.onclose = function(event) {
|
||||||
|
setTimeout(load, 500);
|
||||||
};
|
};
|
||||||
img.src = base + '/static/oxjs/build/Ox.UI/png/transparent.png?' + new Date;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
|
Loading…
Reference in a new issue