27 lines
616 B
JavaScript
27 lines
616 B
JavaScript
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);
|