master #25
|
@ -180,8 +180,12 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
</div>
|
</div>
|
||||||
<div name="logterminalcontainer" style="margin:5px 0 5px 0">
|
<div name="logterminalcontainer" style="margin:5px 0 5px 0">
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul class="my-3" style="list-style:none;padding-left:0;max-height:8rem; overflow-y:auto; overflow-x:hidden">
|
||||||
<li></li>
|
<label class="form-check form-switch form-check-inline">
|
||||||
|
<span class="mr-2">Metadata</span>
|
||||||
|
<input class="form-check-input" type="checkbox" name="toggle_meta">
|
||||||
|
</label>
|
||||||
|
<li style="text-overflow: ellipsis;white-space:nowrap;overflow-x: clip;"></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="d-flex flex-column align-items-end" style="gap: 3px;">
|
<div class="d-flex flex-column align-items-end" style="gap: 3px;">
|
||||||
<div class="d-flex align-items-center" style="gap:5px" title="${this.getLabel("generate_code_help")}">
|
<div class="d-flex align-items-center" style="gap:5px" title="${this.getLabel("generate_code_help")}">
|
||||||
|
@ -967,13 +971,20 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
target : "ul",
|
target : "ul",
|
||||||
|
on_click: ev=>{
|
||||||
|
const tgt = ev.target
|
||||||
|
const ul = ev.currentTarget
|
||||||
|
if(tgt.getAttribute("name") === "toggle_meta"){
|
||||||
|
Array.prototype.slice.call(ul.querySelectorAll("li.metadata")).forEach(e=>e.classList.toggle("d-none"))
|
||||||
|
}
|
||||||
|
},
|
||||||
recurse : [
|
recurse : [
|
||||||
{
|
{
|
||||||
target : "li",
|
target : "li",
|
||||||
"in" : (e,d)=>{
|
"in" : (e,d)=>{
|
||||||
const resources = d.resources ? d.resources : []
|
const resources = d.resources ? d.resources : []
|
||||||
return resources.map(l=>{
|
return resources.map(l=>{
|
||||||
return { href : this.#serviceurl + "/executions/" + d.id + "/" + l.path, path : l.path}
|
return { id: d.id, size: l.size, href : this.#serviceurl + "/executions/" + d.id + "/" + l.path, path : l.path}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
on_click : ev=>{
|
on_click : ev=>{
|
||||||
|
@ -982,7 +993,17 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
this.download(href, name)
|
this.download(href, name)
|
||||||
},
|
},
|
||||||
apply : (e,d)=>{
|
apply : (e,d)=>{
|
||||||
e.innerHTML = `<a href="${d.href}" onclick="event.preventDefault()">${d.path}</a>`
|
const regexp = /^metadata.+|^auth.+|.+\/ccp-entrypoint.sh$|.+\/ccpenv$|.+\/docker-compose.yaml/
|
||||||
|
var size = ""
|
||||||
|
if(d.path.match(regexp)){
|
||||||
|
e.classList.add("metadata")
|
||||||
|
e.classList.add("d-none")
|
||||||
|
}else if(d.size){
|
||||||
|
const s = Number(d.size)
|
||||||
|
var i = s === 0 ? 0 : Math.floor(Math.log(s) / Math.log(1024));
|
||||||
|
size = `[${+((s / Math.pow(1024, i)).toFixed(2)) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]}]`
|
||||||
|
}
|
||||||
|
e.innerHTML = `<small class="text-muted">${size} </small><a href="${d.href}" onclick="event.preventDefault()">${d.path}</a>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue