From 4be50cdd312aced94789c010ee80c72c0a2ba03b Mon Sep 17 00:00:00 2001 From: dcore94 Date: Tue, 7 Mar 2023 18:51:56 +0100 Subject: [PATCH] aligned execution form to new compatibility mode based on infrastructures --- ccp/js/executionformcontroller.js | 50 ++++--------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index e96f959..050dee7 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -88,12 +88,9 @@ class CCPExecutionForm extends HTMLElement{ } ).then(data=>{ this.#data = data - const rts = - this.#data.links - .filter(l => l.rel === "compatibleWith") - .map(l=>l.href.replace("runtimes/","")) - .join(" ") - return this.#boot.secureFetch(this.#serviceurl + "/infrastructures/runtimes?runtimes=" + rts) + const infra = + this.#data.links.filter(l => l.rel === "compatibleWith")[0] + return this.#boot.secureFetch(this.#serviceurl + "/" + infra.href) }).then(resp=>{ this.#data.executable = resp.status === 200 @@ -195,12 +192,9 @@ class CCPExecutionForm extends HTMLElement{ this.#data = m_and_r[0] requestdata = m_and_r[1] this.#method = this.#data.id - const rts = - this.#data.links - .filter(l => l.rel === "compatibleWith") - .map(l=>l.href.replace("runtimes/","")) - .join(" ") - return this.#boot.secureFetch(this.#serviceurl + "/infrastructures/runtimes?runtimes=" + rts) + const infra = + this.#data.links.filter(l => l.rel === "compatibleWith")[0] + return this.#boot.secureFetch(this.#serviceurl + "/" + infra.href) }).then(resp=>{ this.#data.executable = resp.status === 200 }).then(()=>{ @@ -312,35 +306,3 @@ class CCPExecutionForm extends HTMLElement{ } window.customElements.define('d4s-ccp-executionform', CCPExecutionForm); - -class CCPExecutionEnvironmentOption extends HTMLOptionElement{ - - #infrastructure; - #runtime; - - constructor(runtime, infrastructure){ - super(`${runtime.name} [${infrastructure.name}]`, runtime["descriptor-id"]) - this.#runtime = runtime - this.#infrastructure = infrastructure - this.textContent = `${runtime.name} [${infrastructure.name}]` - this.value = this.runtimeId - } - - get infrastructureName(){ - return this.#infrastructure.name - } - - get infrastructureId(){ - return this.#infrastructure.id - } - - get runtimeName(){ - return this.#runtime.name - } - - get runtimeId(){ - return this.#runtime["descriptor-id"] - } -} - -window.customElements.define('d4s-ccp-environment-option', CCPExecutionEnvironmentOption, {extends:'option'});