fix communications between form and monitor

This commit is contained in:
dcore94 2023-05-05 18:00:40 +02:00
parent 70f8165077
commit cf0563dd43
2 changed files with 3 additions and 6 deletions

View File

@ -161,12 +161,8 @@ class CCPExecutionForm extends HTMLElement{
if(data.status !== "accepted"){
throw "Execution has not been accepted by server"
}
const event = new CustomEvent('newexecution', { detail: data.jobID });
const event = new CustomEvent('newexecution', { detail: data });
document.dispatchEvent(event)
this.#executionmonitor = document.querySelector("d4s-ccp-executionhistory")
if(this.#executionmonitor){
this.#executionmonitor.addExecution( { self : data.links[0].href, events : [data], jobID : data.jobID, method : this.#data.title})
}
this.unlockRender()
}).catch(err => {alert("Unable to call execute: " + err); this.unlockRender()})
}

View File

@ -260,6 +260,7 @@ class CCPExecutionHistory extends HTMLElement {
connectNewExecution(){
document.addEventListener("newexecution", ev=>{
this.#data = [ {id: ev.detail } ].concat(this.#data)
this.updateList()
})
}