diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 73139bd..3010a1a 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -266,7 +266,7 @@ class CCPExecutionForm extends HTMLElement{ return Array.prototype.slice.call(this.#rootdoc.querySelectorAll("d4s-ccp-output")) } - initValues(inputs){ + initInputValues(inputs){ Object.keys(inputs).forEach(k=>{ const w = this.#rootdoc.querySelector(`d4s-ccp-input[name=${k}]`) if(w){ @@ -274,6 +274,11 @@ class CCPExecutionForm extends HTMLElement{ } }) } + + initOptionValues(request){ + const autoarchiveoption = this.#rootdoc.querySelector("input[name='auto-archive-outputs']") + autoarchiveoption.checked = request.subscribers && request.subscribers.filter(s=>s === "http://registry:8080/executions/archive-to-folder").length === 1 + } prepareFromExecution(exec){ let f1 = @@ -306,7 +311,8 @@ class CCPExecutionForm extends HTMLElement{ this.#data.executable = resp.status === 200 }).then(()=>{ this.showMethod() - this.initValues(requestdata.inputs) + this.initInputValues(requestdata.inputs) + this.initOptionValues(requestdata) }).catch(err=>alert(err)) } @@ -368,10 +374,6 @@ class CCPExecutionForm extends HTMLElement{ target: "p.description", apply : (e,d)=>e.textContent = d.description }, - { - target: "input[name='auto-archive-outputs']", - apply : (e,d)=>e.checked = d.subscribers && d.subscribers.filter(s=>s === "http://registry:8080/executions/archive-to-folder").length === 1 - }, { target: "div.ccp-inputs", in : (e,d)=>d,