From 3f1bb41d5da4eb4ded0e417665846bf636318029 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 2 Feb 2023 12:42:03 +0100 Subject: [PATCH] added support for Level 0 and buttons for Level 1 and Level 2 re-executions --- ccp/js/executionhistorycontroller.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 0384a08..ebace26 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -92,9 +92,15 @@ class CCPExecutionHistory extends HTMLElement { + + + @@ -263,6 +269,17 @@ class CCPExecutionHistory extends HTMLElement { }).catch(err=>{ console.error(err)}) } + reexecute(id,level){ + this.#boot.secureFetch(`${this.#serviceurl}/executions/${id}/level/${level}`, { method: "POST" }) + .then(reply =>{ + if (reply.status !== 200) { + throw "Unable to re-execute" + } + }).then(()=>{ + alert("Re-execution is WIP. Stay tuned") + }).catch(err=>{ console.error(err)}) + } + #execution_list_bss = { template : "#EXECUTIOM_LIST_TEMPLATE", target : "ul[name=ccp_execution_list]", @@ -335,6 +352,14 @@ class CCPExecutionHistory extends HTMLElement { const id = ev.currentTarget.getAttribute("data-index") this.export(id, "application/prov-o+xml", id + ".xml") } + if(ev.target.getAttribute("name") === "reexecute1"){ + const id = ev.currentTarget.getAttribute("data-index") + this.reexecute(id, 1) + } + if(ev.target.getAttribute("name") === "reexecute2"){ + const id = ev.currentTarget.getAttribute("data-index") + this.reexecute(id, 2) + } }, recurse : [ {