Add websockets and notify frontend when an item is processed

This commit is contained in:
eikek
2021-11-06 21:32:07 +01:00
parent f38d520a1d
commit 3e58d97f72
17 changed files with 243 additions and 114 deletions

View File

@ -135,3 +135,13 @@ elmApp.ports.printElement.subscribe(function(id) {
}
}
});
var socket = new WebSocket('ws://localhost:7880/api/v1/sec/ws');
socket.addEventListener("message", function(event) {
if (event.data != "keep-alive" && event.data) {
elmApp.ports.receiveWsMessage.send(event.data);
}
});
// elmApp.ports.sendWsMessage.subscribe(function(msg) {
// socket.send(msg);
// });