removed some logs from boot, it's now possible to drag and drop archived executions
This commit is contained in:
parent
fd858f811a
commit
423cfc7bed
|
@ -107,14 +107,14 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
|
||||||
startStateChecker() {
|
startStateChecker() {
|
||||||
this.#interval = window.setInterval(() => {
|
this.#interval = window.setInterval(() => {
|
||||||
if (this.#locked) {
|
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) {
|
} else if (!this.authenticated) {
|
||||||
window.alert("Not authorized!")
|
window.alert("Not authorized!")
|
||||||
} else {
|
} else {
|
||||||
if (this.#queue.length > 0) {
|
if (this.#queue.length > 0) {
|
||||||
this.#keycloak.updateToken(30).then(() => {
|
this.#keycloak.updateToken(30).then(() => {
|
||||||
if (this.#audience) {
|
if (this.#audience) {
|
||||||
console.log("Checking entitlement for audience", this.#audience)
|
//console.log("Checking entitlement for audience", this.#audience)
|
||||||
const audience = encodeURIComponent(this.#audience)
|
const audience = encodeURIComponent(this.#audience)
|
||||||
return this.entitlement(audience)
|
return this.entitlement(audience)
|
||||||
} else {
|
} else {
|
||||||
|
@ -122,7 +122,7 @@ window.customElements.define('d4s-boot-2', class extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
}).then(token => {
|
}).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
|
//transform all queued requests to fetches
|
||||||
//console.log("All pending requests to promises")
|
//console.log("All pending requests to promises")
|
||||||
let promises = this.#queue.map(r => {
|
let promises = this.#queue.map(r => {
|
||||||
|
|
|
@ -343,6 +343,22 @@ class CCPExecutionForm extends HTMLElement{
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareFromExecution(exec){
|
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 =
|
let f1 =
|
||||||
this.#boot.secureFetch(this.#serviceurl + `/executions/${exec.id}/metadata/method.json`)
|
this.#boot.secureFetch(this.#serviceurl + `/executions/${exec.id}/metadata/method.json`)
|
||||||
.then(resp=>{
|
.then(resp=>{
|
||||||
|
|
|
@ -637,8 +637,8 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
}
|
}
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
100% {
|
100% {
|
||||||
-webkit-transform: rotate(360deg);
|
-webkit-transform: rotate(-360deg);
|
||||||
transform:rotate(360deg);
|
transform:rotate(-360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -687,7 +687,10 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
runtime : req.inputs.ccpimage,
|
runtime : req.inputs.ccpimage,
|
||||||
replicas : req.inputs.ccpreplicas ? req.inputs.ccpreplicas : 1,
|
replicas : req.inputs.ccpreplicas ? req.inputs.ccpreplicas : 1,
|
||||||
href : `items/${executionfolders[j].id}/download`,
|
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);
|
if(this.#archived[entry.method]) this.#archived[entry.method].push(entry);
|
||||||
else this.#archived[entry.method] = [entry]
|
else this.#archived[entry.method] = [entry]
|
||||||
|
@ -983,6 +986,15 @@ class CCPExecutionHistory extends HTMLElement {
|
||||||
e.setAttribute("data-href", d.href)
|
e.setAttribute("data-href", d.href)
|
||||||
e.setAttribute("data-wsid", d.wsid)
|
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=>{
|
on_click: ev=>{
|
||||||
if(ev.target.getAttribute("name") === "restore"){
|
if(ev.target.getAttribute("name") === "restore"){
|
||||||
if(window.confirm(this.getLabel("confirm_restore_execution"))){
|
if(window.confirm(this.getLabel("confirm_restore_execution"))){
|
||||||
|
|
Loading…
Reference in New Issue