added management of other kind of message

This commit is contained in:
dcore94 2023-06-23 11:55:34 +02:00
parent 5d3d3542cb
commit 32a5fc7a69
1 changed files with 5 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class CCPExecutionHistory extends HTMLElement {
#data = [];
#pending = [];
#filtered = [];
#socket = null;
#sockets = null;
#interval = null;
#searchfield = null;
#fileupload = null;
@ -271,6 +271,10 @@ class CCPExecutionHistory extends HTMLElement {
this.#socket = new WebSocket(this.#broadcasturl + "/executions");
this.#socket.onmessage = event=>{
const data = JSON.parse(event.data)
if(!data.jobID){
console.log("New logs " + event.data)
return
}
let exec = this.#data.filter(e=>e.id === data.jobID)[0]
if(exec){
this.refreshExecution(exec.id)