From d7b062828b8b130388f11914e2ac81dc7ee0d9ed Mon Sep 17 00:00:00 2001 From: dcore94 Date: Mon, 10 Jun 2024 11:43:16 +0200 Subject: [PATCH 01/12] added width 100% --- ccp/js/inputwidgetcontroller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 4eb48a9..c105a4a 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -808,7 +808,7 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController { -
+
@@ -825,7 +825,7 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController {
Draw and export geometry
-
+
+ +
+ ` + } + async refreshArchivedExecutions(){ + this.showLoading(this.#rootdoc.querySelector("ul[name=ccp_archived_execution_list]")) await this.initWorkspace() if(this.#execfolderid){ const folders = await this.#ws.listFolder(this.#execfolderid) @@ -629,12 +663,19 @@ class CCPExecutionHistory extends HTMLElement { for(let j=0; j < executionfolders.length; j++){ const metadatafolder = await this.#ws.findByName(executionfolders[j].id, "metadata") if(metadatafolder.length === 1){ + //parse all metada content that is useful to build up an entry const metadata = await this.#ws.download(metadatafolder[0].id, null, true) const zip = new JSZip() const req = JSON.parse(await (zip.loadAsync(metadata).then(z=>z.file("metadata/request.json").async("string")))) const status = JSON.parse(await (zip.loadAsync(metadata).then(z=>z.file("metadata/jobStatus.json").async("string")))) const meth = JSON.parse(await (zip.loadAsync(metadata).then(z=>z.file("metadata/method.json").async("string")))) const infra = JSON.parse(await (zip.loadAsync(metadata).then(z=>z.file("metadata/infrastructure.json").async("string")))) + const parser = new DOMParser() + // Fasted way to get context is from prov-o. If it doesn't match the context in boot skip this execution + const provo = parser.parseFromString(await zip.loadAsync(metadata).then(z=>z.file("metadata/prov-o.xml").async("string")), "text/xml") + const context = provo.querySelector("entity[*|id='d4s:VRE']>value").textContent + if(context !== this.#boot.context && context.replaceAll("/", "%2F") !== this.#boot.context) continue; + //build entry from downloaded data const entry = { id : req.id, status : status.status, @@ -647,9 +688,10 @@ class CCPExecutionHistory extends HTMLElement { infrastructure: infra.name, infrastructuretype : infra.type, ccpnote : req.inputs.ccpnote ? req.inputs.ccpnote : "", - runtime : req.inputs.ccpruntime, + runtime : req.inputs.ccpimage, replicas : req.inputs.ccpreplicas ? req.inputs.ccpreplicas : 1, - href : `items/${executionfolders[j].id}/download` + href : `items/${executionfolders[j].id}/download`, + wsid : executionfolders[j].id } if(this.#archived[entry.method]) this.#archived[entry.method].push(entry); else this.#archived[entry.method] = [entry] @@ -856,7 +898,8 @@ class CCPExecutionHistory extends HTMLElement { e.textContent = rt + (d.replicas && d.replicas !== "1" ? ' x ' + d.replicas : '') const t = infratype.match(/docker/i) ? "docker" : null const t2 = !t && infratype.match(/lxd/i) ? "lxd" : t - e.classList.add(t2) + const t3 = !t2 && infratype.match(/galaxy/i) ? "galaxy" : t + e.classList.add(t3) } }, { @@ -909,7 +952,7 @@ class CCPExecutionHistory extends HTMLElement { } #archived_execution_list_bss = { - template : "#ARCHIVED_EXECUTIOM_LIST_TEMPLATE", + template : "#ARCHIVED_EXECUTION_LIST_TEMPLATE", target : "ul[name=ccp_archived_execution_list]", in : ()=>this, recurse:[ @@ -921,14 +964,14 @@ class CCPExecutionHistory extends HTMLElement { target : "details[name=level1]", apply : (e,d)=>{ e.alt = e.title = d - if(sessionStorage.getItem(d) === "open") e.open = "open"; + if(sessionStorage.getItem("arch_" + d) === "open") e.open = "open"; else e.removeAttribute("open"); }, on_toggle : ev=>{ if(ev.target.open){ - sessionStorage.setItem(ev.currentTarget.alt, 'open') + sessionStorage.setItem("arch_" + ev.currentTarget.alt, 'open') }else{ - sessionStorage.removeItem(ev.currentTarget.alt) + sessionStorage.removeItem("arch_" + ev.currentTarget.alt) } }, }, @@ -942,6 +985,7 @@ class CCPExecutionHistory extends HTMLElement { apply : (e,d)=>{ e.setAttribute("data-index", d.id) e.setAttribute("data-href", d.href) + e.setAttribute("data-wsid", d.wsid) }, on_click: ev=>{ if(ev.target.getAttribute("name") === "restore"){ @@ -949,21 +993,27 @@ class CCPExecutionHistory extends HTMLElement { const href = ev.currentTarget.getAttribute("data-href") this.fromArchiveFolder(href) } + }else if(ev.target.getAttribute("name") === "delete"){ + if(window.confirm(this.getLabel("confirm_delete_archived_execution"))){ + const wsid = ev.currentTarget.getAttribute("data-wsid") + this.deleteArchiveFolder(wsid) + } } + }, recurse : [ { target : "details", apply : (e,d)=>{ e.alt = e.title = d.id - if(sessionStorage.getItem(d.id) === "open") e.open = "open"; + if(sessionStorage.getItem("arch_" + d.id) === "open") e.open = "open"; else e.removeAttribute("open"); }, on_toggle : ev=>{ if(ev.target.open){ - sessionStorage.setItem(ev.currentTarget.alt, 'open') + sessionStorage.setItem("arch_" + ev.currentTarget.alt, 'open') }else{ - sessionStorage.removeItem(ev.currentTarget.alt) + sessionStorage.removeItem("arch_" + ev.currentTarget.alt) } } }, @@ -1037,7 +1087,8 @@ class CCPExecutionHistory extends HTMLElement { e.textContent = rt + (d.replicas && d.replicas !== "1" ? ' x ' + d.replicas : '') const t = infratype.match(/docker/i) ? "docker" : null const t2 = !t && infratype.match(/lxd/i) ? "lxd" : t - e.classList.add(t2) + const t3 = !t2 && infratype.match(/galaxy/i) ? "galaxy" : t + e.classList.add(t3) } }, { -- 2.17.1 From 992e085a76be3bf9f076f399d60c5ba625e79f64 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Tue, 11 Jun 2024 16:50:07 +0200 Subject: [PATCH 04/12] removed unnecessary details toggle --- ccp/js/executionhistorycontroller.js | 86 +++++++++------------------- 1 file changed, 26 insertions(+), 60 deletions(-) diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 5e055af..73826dd 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -207,36 +207,32 @@ class CCPExecutionHistory extends HTMLElement {
  • -
    - - - -
    - - -
    -

    - . - -

    -

    - : - -

    -
    -
    - - -
    -
    + + +
    + + +
    +

    + . + +

    +

    + : + +

    +
    + + +
@@ -1002,21 +998,6 @@ class CCPExecutionHistory extends HTMLElement { }, recurse : [ - { - target : "details", - apply : (e,d)=>{ - e.alt = e.title = d.id - if(sessionStorage.getItem("arch_" + d.id) === "open") e.open = "open"; - else e.removeAttribute("open"); - }, - on_toggle : ev=>{ - if(ev.target.open){ - sessionStorage.setItem("arch_" + ev.currentTarget.alt, 'open') - }else{ - sessionStorage.removeItem("arch_" + ev.currentTarget.alt) - } - } - }, { target : "span[name=version]", apply : (e,d)=>{ @@ -1090,21 +1071,6 @@ class CCPExecutionHistory extends HTMLElement { const t3 = !t2 && infratype.match(/galaxy/i) ? "galaxy" : t e.classList.add(t3) } - }, - { - target : "button[name=codegen]", - apply : (e,d)=>e.setAttribute("data-index", d.id), - on_click: (ev)=>{ - const id = ev.target.getAttribute("data-index") - const langsel = ev.target.parentElement.querySelector("select[name=language-selector]") - const lang = langsel.value - const ext = langsel.selectedOptions[0].getAttribute("data-ext") - this.generateCode(id, lang, `${id}.${ext}`) - } - }, - { - target : "a[name=direct_link_execution]", - apply : (e,d)=>e.href = window.location.origin + window.location.pathname + "?execution=" + d.id } ] } -- 2.17.1 From fd858f811a4bf60f4f21d987dd1d97e921ee5523 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Tue, 11 Jun 2024 16:59:06 +0200 Subject: [PATCH 05/12] added different color theme for archived --- ccp/js/executionhistorycontroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 73826dd..ed84f62 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -200,7 +200,7 @@ class CCPExecutionHistory extends HTMLElement {