make edit and execute buttons optional

This commit is contained in:
dcore94 2023-03-29 17:28:02 +02:00
parent 3d40deba3c
commit f8ee97d6b8
1 changed files with 7 additions and 4 deletions

View File

@ -120,17 +120,16 @@ class CCPMethodList extends HTMLElement{
}
connectedCallback(){
this.#allowedit = this.getAttribute("allow-edit") === "true"
this.#allowexecute = this.getAttribute("allow-execute") === "true"
}
fetchProcesses(){
console.log("Calling fetch processes")
this.#boot.secureFetch(this.#serviceurl + "/methods").
then(resp=>{
console.log("Received resp for processes ", resp.status)
return resp.json()
}).then(data=>{
console.log("Processes parsed to json", data)
this.#data = data
this.updateList()
return this.fetchInfrastructures()
@ -327,7 +326,11 @@ class CCPMethodList extends HTMLElement{
},
{
target: "button[name=executable]",
apply : (e,d)=>{ e.style.display = d.executable ? "revert" : "none" }
apply : (e,d)=>{ e.style.display = d.executable && this.#allowexecute ? "revert" : "none" }
},
{
target: "button[name=edit]",
apply : (e,d)=>{ e.style.display = this.#allowedit ? "revert" : "none" }
},
{
target : "span[name=author]",