From e479d75ff18d7205f158f39a1f6b7c5452dfb0b7 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 8 Sep 2022 16:03:28 +0200 Subject: [PATCH] many fixes --- ccp/js/executionmonitorcontroller.js | 8 +- ccp/js/infrastructurelistcontroller.js | 11 +- ccp/js/methodeditorcontroller.js | 155 +++++++++++-------------- 3 files changed, 77 insertions(+), 97 deletions(-) diff --git a/ccp/js/executionmonitorcontroller.js b/ccp/js/executionmonitorcontroller.js index 123e7bd..5dd504e 100644 --- a/ccp/js/executionmonitorcontroller.js +++ b/ccp/js/executionmonitorcontroller.js @@ -53,7 +53,7 @@ class CCPExecutionMonitor extends HTMLElement { } refreshExecution(execution){ - this.#boot.secureFetch(execution.self).then(reply =>{ + this.#boot.secureFetch(`${this.#serviceurl}/executions/${execution.jobID}`).then(reply =>{ if(reply.status === 200) return reply.json(); else throw "Unable to load job links" }).then(data=>{ @@ -142,7 +142,11 @@ class CCPExecutionMonitor extends HTMLElement { recurse : [ { target : "li", - "in" : (e,d)=>{return d.links.map(l=>{ return { href : d.self + "/" + l.path, path : l.path} })}, + "in" : (e,d)=>{ + return d.links.map(l=>{ + return { href : this.#serviceurl + "/executions/" + d.jobID + "/" + l.path, path : l.path} + }) + }, on_click : ev=>{ const href = ev.currentTarget.bss_input.data.href const name = ev.currentTarget.bss_input.data.path diff --git a/ccp/js/infrastructurelistcontroller.js b/ccp/js/infrastructurelistcontroller.js index aba0474..8736e87 100644 --- a/ccp/js/infrastructurelistcontroller.js +++ b/ccp/js/infrastructurelistcontroller.js @@ -76,11 +76,12 @@ class CCPInfrastructureList extends HTMLElement{ return resp.json() }).then(data=>{ this.#infrastructures = data + this.showList() }).catch(err=>{ alert(err) }) - const prom2 = this.#boot.secureFetch(this.#serviceurl + "/runtimes"). + /*const prom2 = this.#boot.secureFetch(this.#serviceurl + "/runtimes"). then(resp=>{ if(resp.status !== 200) throw "Unable to fetch runtimes"; return resp.json() @@ -92,7 +93,7 @@ class CCPInfrastructureList extends HTMLElement{ Promise.all([prom1, prom2]).then(results=>{ this.showList() - }) + })*/ } refreshInfrastructures(){ @@ -165,10 +166,10 @@ class CCPInfrastructureList extends HTMLElement{ showDeployableRuntimes(infra){ const alreadydeployed = infra.runtimes.map(r=>r["descriptor-id"]) - const options = this.#runtimes.filter(r=>{ + const options = infra.available_runtimes.filter(r=>{ return infra.type === r.type && alreadydeployed.indexOf(r.id) === -1 }).map(r=>{ - return `` + return `` }).join("\n") return `
@@ -185,7 +186,7 @@ class CCPInfrastructureList extends HTMLElement{ showRuntimes(infra){ return infra.runtimes.map(r =>{ return ` -
  • +
  • ${r.name}
      diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index ded60fb..d9b01d4 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -8,6 +8,8 @@ class CCPMethodEditorController extends HTMLElement{ #locked = false; #isupdate = false; + #cloneornew_dialog = null; + #dragging_method = null; #tmp_inputs = [] #tmp_outputs = [] @@ -25,82 +27,29 @@ class CCPMethodEditorController extends HTMLElement{ parameters : [ { name : "deploy-script", - value : [ -` -- hosts: localhost - tasks: - - name: hookup instance - add_host: - name: "{ instancename }" - ansible_connection: lxd - groupname: "targets" -` - ] + value : [] }, { name : "execute-script", - value : [ -` -- hosts: localhost - tasks: - - name: hookup instance - add_host: - name: "{ instancename }" - ansible_connection: lxd - groupname: "targets" -` - ] - }, - { - name : "fetch-output-script", - value : [ -` -- hosts: localhost - tasks: - - name: hookup instance - add_host: - name: "{ instancename }" - ansible_connection: lxd - groupname: "targets" -` - ] + value : [] }, { name : "undeploy-script", - value : [ -` -- hosts: localhost - tasks: - - name: hookup instance - add_host: - name: "{ instancename }" - ansible_connection: lxd - groupname: "targets" -` - ] - }, - { - name : "cancel-script", - value : [ -` -- hosts: localhost - tasks: - - name: hookup instance - add_host: - name: "{ instancename }" - ansible_connection: lxd - groupname: "targets" -` - ] + value : [] } ] }, links : [] } + #scripts = ` + + ` + #style = ` - + +