diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 6270cc2..659e1d1 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -77,6 +77,17 @@ class CCPExecutionForm extends HTMLElement{ +
+
+
Options
+
+
+
+ + +
+
+
Outputs
@@ -236,6 +247,13 @@ class CCPExecutionForm extends HTMLElement{ outputs.forEach(o=>{ if(o.enabled) request.outputs[o.name] = { transmissionMode : "value" }; }) + + const autoarchiveoption = this.#rootdoc.querySelector("input[name='auto-archive-outputs']") + if (autoarchiveoption.checked){ + request.subscribers = [ + { successUri : "http://registry:8080/executions/archive-to-folder" } + ] + } return request } @@ -248,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){ @@ -256,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.successUri === "http://registry:8080/executions/archive-to-folder").length === 1 + } prepareFromExecution(exec){ let f1 = @@ -288,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)) } diff --git a/ccp/js/outputwidgetcontroller.js b/ccp/js/outputwidgetcontroller.js index 64ae654..f8661ec 100644 --- a/ccp/js/outputwidgetcontroller.js +++ b/ccp/js/outputwidgetcontroller.js @@ -22,7 +22,7 @@ class CCPOutputWidgetController extends HTMLElement { render(){ return `
- +
`