aligned execution form to new compatibility mode based on infrastructures

This commit is contained in:
dcore94 2023-03-07 18:51:56 +01:00
parent 6091914e10
commit 4be50cdd31
1 changed files with 6 additions and 44 deletions

View File

@ -88,12 +88,9 @@ class CCPExecutionForm extends HTMLElement{
} }
).then(data=>{ ).then(data=>{
this.#data = data this.#data = data
const rts = const infra =
this.#data.links this.#data.links.filter(l => l.rel === "compatibleWith")[0]
.filter(l => l.rel === "compatibleWith") return this.#boot.secureFetch(this.#serviceurl + "/" + infra.href)
.map(l=>l.href.replace("runtimes/",""))
.join(" ")
return this.#boot.secureFetch(this.#serviceurl + "/infrastructures/runtimes?runtimes=" + rts)
}).then(resp=>{ }).then(resp=>{
this.#data.executable = resp.status === 200 this.#data.executable = resp.status === 200
@ -195,12 +192,9 @@ class CCPExecutionForm extends HTMLElement{
this.#data = m_and_r[0] this.#data = m_and_r[0]
requestdata = m_and_r[1] requestdata = m_and_r[1]
this.#method = this.#data.id this.#method = this.#data.id
const rts = const infra =
this.#data.links this.#data.links.filter(l => l.rel === "compatibleWith")[0]
.filter(l => l.rel === "compatibleWith") return this.#boot.secureFetch(this.#serviceurl + "/" + infra.href)
.map(l=>l.href.replace("runtimes/",""))
.join(" ")
return this.#boot.secureFetch(this.#serviceurl + "/infrastructures/runtimes?runtimes=" + rts)
}).then(resp=>{ }).then(resp=>{
this.#data.executable = resp.status === 200 this.#data.executable = resp.status === 200
}).then(()=>{ }).then(()=>{
@ -312,35 +306,3 @@ class CCPExecutionForm extends HTMLElement{
} }
window.customElements.define('d4s-ccp-executionform', CCPExecutionForm); 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'});