transform executable into action
This commit is contained in:
parent
d2af24b4ed
commit
b243178534
|
@ -13,6 +13,8 @@ class CCPExecutionForm extends HTMLElement{
|
||||||
this.#boot = document.querySelector("d4s-boot-2")
|
this.#boot = document.querySelector("d4s-boot-2")
|
||||||
this.#serviceurl = this.getAttribute("serviceurl")
|
this.#serviceurl = this.getAttribute("serviceurl")
|
||||||
this.#rootdoc = this.attachShadow({ "mode" : "open"})
|
this.#rootdoc = this.attachShadow({ "mode" : "open"})
|
||||||
|
|
||||||
|
this.connectNewExecutionRequest()
|
||||||
this.render()
|
this.render()
|
||||||
this.showMethod()
|
this.showMethod()
|
||||||
}
|
}
|
||||||
|
@ -28,6 +30,14 @@ class CCPExecutionForm extends HTMLElement{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectNewExecutionRequest(){
|
||||||
|
document.addEventListener("newexecutionrequest", ev=>{
|
||||||
|
if(window.confirm("Confirm overwrite of execution form?")){
|
||||||
|
this.setAttribute("method", ev.detail)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
this.#rootdoc.innerHTML = `
|
this.#rootdoc.innerHTML = `
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -88,11 +88,11 @@ class CCPMethodList2 extends HTMLElement{
|
||||||
<span name="version" class="badge badge-primary"></span>
|
<span name="version" class="badge badge-primary"></span>
|
||||||
<span name="author" class="badge badge-warning"></span>
|
<span name="author" class="badge badge-warning"></span>
|
||||||
<div class="float-right d-flex" style="gap:3px">
|
<div class="float-right d-flex" style="gap:3px">
|
||||||
<div name="executable" title="Executable" class="border border-success">
|
<button name="executable" title="Execute" class="btn btn-success ccp-toolbar-button ccp-toolbar-button-small">
|
||||||
<svg viewBox="0 0 48 48" style="fill:green;width:16px;height:16px;display:block">
|
<svg viewBox="0 0 48 48" style="fill:white; stroke:white">
|
||||||
<path d="M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"/>
|
<path d="M10,10 v28 L38,24 Z"/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</button>
|
||||||
<button name="export_method" title="Export this version" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
|
<button name="export_method" title="Export this version" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
|
||||||
<svg viewBox="0 0 24 24"><g><rect fill="none" height="24" width="24"/></g><g><path d="M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"/></g></svg>
|
<svg viewBox="0 0 24 24"><g><rect fill="none" height="24" width="24"/></g><g><path d="M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"/></g></svg>
|
||||||
</button>
|
</button>
|
||||||
|
@ -326,8 +326,12 @@ class CCPMethodList2 extends HTMLElement{
|
||||||
target : "li.ccp-process",
|
target : "li.ccp-process",
|
||||||
"in" : (e,d)=>this.#filtered[d],
|
"in" : (e,d)=>this.#filtered[d],
|
||||||
on_click : ev=>{
|
on_click : ev=>{
|
||||||
|
const id = ev.currentTarget.bss_input.data.id
|
||||||
if(ev.target.getAttribute("name") === "export_method"){
|
if(ev.target.getAttribute("name") === "export_method"){
|
||||||
this.exportMethod(ev.currentTarget.bss_input.data.id)
|
this.exportMethod(id)
|
||||||
|
}else if(ev.target.getAttribute("name") === "executable"){
|
||||||
|
const event = new CustomEvent('newexecutionrequest', { detail: id });
|
||||||
|
document.dispatchEvent(event)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
on_dragstart : ev=>{
|
on_dragstart : ev=>{
|
||||||
|
@ -345,7 +349,7 @@ class CCPMethodList2 extends HTMLElement{
|
||||||
apply : (e,d)=>{ e.textContent = d.version }
|
apply : (e,d)=>{ e.textContent = d.version }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
target: "div[name=executable]",
|
target: "button[name=executable]",
|
||||||
apply : (e,d)=>{ e.style.display = d.executable ? "revert" : "none" }
|
apply : (e,d)=>{ e.style.display = d.executable ? "revert" : "none" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue