From d4748110c8c64aee87bab8ad9f1e05983dc1affd Mon Sep 17 00:00:00 2001 From: dcore94 Date: Fri, 5 May 2023 18:14:08 +0200 Subject: [PATCH] fix communications between form and monitor --- ccp/js/executionformcontroller.js | 1 + ccp/js/executionhistorycontroller.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index c703cb1..3435bb4 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -161,6 +161,7 @@ class CCPExecutionForm extends HTMLElement{ if(data.status !== "accepted"){ throw "Execution has not been accepted by server" } + data.method = this.#data.title const event = new CustomEvent('newexecution', { detail: data }); document.dispatchEvent(event) this.unlockRender() diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 302599f..20afa71 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -258,8 +258,10 @@ class CCPExecutionHistory extends HTMLElement { } connectNewExecution(){ - document.addEventListener("newexecution", ev=>{ - this.#data = [ ev.detail ].concat(this.#data) + document.addEventListener("newexecution", ev=>{ + const s = ev.detail + const dummy = { id : s.jobID, method : s.method, status : "accepted", created : s.updated, updated : s.updated, resources : []} + this.#data = [ dummy ].concat(this.#data) this.updateList() }) }