diff --git a/ccp/executionformfragment.html b/ccp/executionformfragment.html index a6a4708..e64b4da 100644 --- a/ccp/executionformfragment.html +++ b/ccp/executionformfragment.html @@ -21,7 +21,7 @@
diff --git a/ccp/js/infrastructurelistcontroller.js b/ccp/js/infrastructurelistcontroller.js new file mode 100644 index 0000000..69b78dd --- /dev/null +++ b/ccp/js/infrastructurelistcontroller.js @@ -0,0 +1,26 @@ +class CCPInfrastructureList extends HTMLElement{ + + #boot; + #data; + + #serviceurl = "https://nubis1.int.d4science.net:8080" + + constructor(){ + super() + this.#boot = document.querySelector("d4s-boot-2") + this.fetchInfrastructures() + } + + fetchInfrastuctures(){ + this.#boot.service(this.#serviceurl + "/infrastructures", "GET", + (resp)=>this.updateList(resp), + ()=>{ alert("An error occurred while fetching CCP infrastructures.") }) + } + + updateList(resp){ + this.#data = JSON.parse(resp) + } + +} + +window.customElements.define('d4s-ccp-infrastructurelist', CCPInfrastructureList);