Using sqlite database, mt proctor animation.

This commit is contained in:
2020-04-09 22:52:44 -07:00
parent b34a66f697
commit 6ff6387fef
31 changed files with 1525 additions and 280 deletions

View File

@@ -22,7 +22,9 @@ export { sendCommand, setMainOnMessage, setSecondaryOnMessage,
class WebSocketConnection {
location = '';
fullPath = '';
reopen = true;
onmessageProc = () => 'nothing'
ws = null;
constructor(location) {
@@ -35,6 +37,7 @@ class WebSocketConnection {
uri = "ws:";
}
uri += "//" + loc.host;
this.fullPath = uri + '/websocket/' + location;
this.ws = new WebSocket(uri + '/websocket/' + location);
}
@@ -47,8 +50,17 @@ class WebSocketConnection {
this.ws.send(JSON.stringify(cmd));
}
reestablish = () => {
this.ws = new WebSocket(this.fullPath);
this.ws.onmessage = this.onmessageProc;
}
onmessage(proc) {
this.onmessageProc = proc;
this.ws.onmessage = proc;
// this.ws.onclose = () => {
// setTimeout(this.reestablish, 500);
// }
}
onopen(proc) {