removed some logs from boot, it's now possible to drag and drop archived executions

This commit is contained in:
dcore94 2024-06-12 12:46:59 +02:00
parent fd858f811a
commit 423cfc7bed
3 changed files with 34 additions and 6 deletions

View File

@ -107,14 +107,14 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
startStateChecker() {
this.#interval = window.setInterval(() => {
if (this.#locked) {
console.log("Still locked. Currently has " + this.#queue.length + " pending requests.")
//console.log("Still locked. Currently has " + this.#queue.length + " pending requests.")
} else if (!this.authenticated) {
window.alert("Not authorized!")
} else {
if (this.#queue.length > 0) {
this.#keycloak.updateToken(30).then(() => {
if (this.#audience) {
console.log("Checking entitlement for audience", this.#audience)
//console.log("Checking entitlement for audience", this.#audience)
const audience = encodeURIComponent(this.#audience)
return this.entitlement(audience)
} else {
@ -122,7 +122,7 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
}
}).then(token => {
console.log("Authorized. Token exp: " + this.expirationDate(this.parseJwt(token).exp))
//console.log("Authorized. Token exp: " + this.expirationDate(this.parseJwt(token).exp))
//transform all queued requests to fetches
//console.log("All pending requests to promises")
let promises = this.#queue.map(r => {

View File

@ -343,6 +343,22 @@ class CCPExecutionForm extends HTMLElement{
}
prepareFromExecution(exec){
//if exec carries already full information then it comes from archive. Use this info instead of fetching.
if(exec.fullrequest && exec.fullmethod && exec.fullinfrastructure){
this.#data = exec.fullmethod
this.#method = this.#data.id
this.#boot.secureFetch(this.#serviceurl + "/infrastructures/" + exec.fullinfrastructure.id)
.then(resp=>{
if(resp.ok){
this.showMethod()
this.initInputValues(exec.fullrequest.inputs)
this.initOptionValues(exec.fullrequest)
}else throw("Unable to find infrastructure")
}).catch(err=>alert(err))
return
}
//fetch method and request and validate infra
let f1 =
this.#boot.secureFetch(this.#serviceurl + `/executions/${exec.id}/metadata/method.json`)
.then(resp=>{

View File

@ -637,8 +637,8 @@ class CCPExecutionHistory extends HTMLElement {
}
@keyframes spin {
100% {
-webkit-transform: rotate(360deg);
transform:rotate(360deg);
-webkit-transform: rotate(-360deg);
transform:rotate(-360deg);
}
}
</style>
@ -687,7 +687,10 @@ class CCPExecutionHistory extends HTMLElement {
runtime : req.inputs.ccpimage,
replicas : req.inputs.ccpreplicas ? req.inputs.ccpreplicas : 1,
href : `items/${executionfolders[j].id}/download`,
wsid : executionfolders[j].id
wsid : executionfolders[j].id,
fullrequest : req,
fullmethod : meth,
fullinfrastructure : infra
}
if(this.#archived[entry.method]) this.#archived[entry.method].push(entry);
else this.#archived[entry.method] = [entry]
@ -983,6 +986,15 @@ class CCPExecutionHistory extends HTMLElement {
e.setAttribute("data-href", d.href)
e.setAttribute("data-wsid", d.wsid)
},
on_dragstart : ev=>{
ev.dataTransfer.effectAllowed = 'move'
ev.dataTransfer.setData('text/html', ev.currentTarget.innerHTML)
ev.dataTransfer.setData('text/plain+ccpexecution', ev.currentTarget.getAttribute("data-index"))
ev.dataTransfer.setData('application/json+ccpexecution', JSON.stringify(ev.currentTarget.bss_input.data))
},
on_dragend : ev=>{
ev.preventDefault()
},
on_click: ev=>{
if(ev.target.getAttribute("name") === "restore"){
if(window.confirm(this.getLabel("confirm_restore_execution"))){