master #17

Merged
m.lettere merged 4 commits from master into prod 2024-06-10 09:45:15 +02:00
1 changed files with 17 additions and 10 deletions
Showing only changes of commit a013536dfb - Show all commits

View File

@ -16,6 +16,8 @@ class CCPExecutionHistory extends HTMLElement {
#messages = {
"en" : {
"search" : "Search",
"refresh" : "Refresh contents of Execution Monitor",
"execution_monitor" : "Execution Monitor",
"failed_count_help" : "Count of failed executions",
"successful_count_help" : "Count of successful executions",
"running_count_help" : "Count of running executions",
@ -28,7 +30,12 @@ class CCPExecutionHistory extends HTMLElement {
"generate_code" : "Generate code for",
"generate_code_help" : "Generate code that replicates this exact execution on a chosen programming language or runtime",
"direct_link" : "Direct link",
"direct_link_help" : "Navigate to the direct link for opening this exact execution in the exeuction form"
"import_file_help" : "Import from a previosusly exported file on your local disk",
"import_link_help" : "Import execution from a link in your workspace",
"direct_link_help" : "Navigate to the direct link for opening this exact execution in the exeuction form",
"confirm_import_link" : "Please confirm importing of execution from link",
"confirm_import_file" : "Please confirm importing of execution from file",
"confirm_delete_execution" : "Please confirm deletion of this execution"
}
}
@ -103,7 +110,7 @@ class CCPExecutionHistory extends HTMLElement {
<span name="status" class="ml-1 badge"></span>
<div class="d-flex float-right" style="gap: 3px 5px; max-width: 40%; min-width:60px; flex-wrap:wrap;">
${ this.#archive ? `
<button data-index="0" name="archive" title="${this.getLabel("archive_execution_help_help")}" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<button data-index="0" name="archive" title="${this.getLabel("archive_execution_help")}" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<svg viewBox="0 96 960 960"><path d="M140 796h680V516H140v280Zm540.118-90Q701 706 715.5 691.382q14.5-14.617 14.5-35.5Q730 635 715.382 620.5q-14.617-14.5-35.5-14.5Q659 606 644.5 620.618q-14.5 14.617-14.5 35.5Q630 677 644.618 691.5q14.617 14.5 35.5 14.5ZM880 456h-85L695 356H265L165 456H80l142-142q8-8 19.278-13 11.278-5 23.722-5h430q12.444 0 23.722 5T738 314l142 142ZM140 856q-24.75 0-42.375-17.625T80 796V456h800v340q0 24.75-17.625 42.375T820 856H140Z"/></svg>
</button>`
: ``
@ -114,7 +121,7 @@ class CCPExecutionHistory extends HTMLElement {
<!-- button data-index="0" name="zip" title="Download as zip archive" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<svg viewBox="0 0 48 48"><path d="M7 40q-1.15 0-2.075-.925Q4 38.15 4 37V11q0-1.15.925-2.075Q5.85 8 7 8h14l3 3h17q1.15 0 2.075.925Q44 12.85 44 14v23q0 1.15-.925 2.075Q42.15 40 41 40Zm25-3h9V14h-9v4.6h4.6v4.6H32v4.6h4.6v4.6H32ZM7 37h20.4v-4.6H32v-4.6h-4.6v-4.6H32v-4.6h-4.6V14h-4.65l-3-3H7v26Zm0-23v-3 26-23Z"/></svg>
</button-->
<button data-index="0" name="archiveoutputs" title="${this.getLabel("archive_outputs_help_help")}" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<button data-index="0" name="archiveoutputs" title="${this.getLabel("archive_outputs_help")}" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<svg viewBox="0 0 48 48"><path d="M7 40q-1.15 0-2.075-.925Q4 38.15 4 37V11q0-1.15.925-2.075Q5.85 8 7 8h14l3 3h17q1.15 0 2.075.925Q44 12.85 44 14v23q0 1.15-.925 2.075Q42.15 40 41 40Zm25-3h9V14h-9v4.6h4.6v4.6H32v4.6h4.6v4.6H32ZM7 37h20.4v-4.6H32v-4.6h-4.6v-4.6H32v-4.6h-4.6V14h-4.65l-3-3H7v26Zm0-23v-3 26-23Z"/></svg>
</button>
<button data-index="0" name="reexecute1" title="${this.getLabel("re-submit_help")}" class="btn btn-info ccp-toolbar-button ccp-toolbar-button-small">
@ -179,19 +186,19 @@ class CCPExecutionHistory extends HTMLElement {
<div class="card-header">
<div class="ccp-toolbar-header d-flex flex-wrap justify-content-between">
<div>
<span name="header">Execution Monitor</span>
<span name="header">${this.getLabel("execution_monitor")}</span>
</div>
<div class="d-flex flex-wrap" style="gap:2px">
<button name="refresh" class="btn btn-primary ccp-toolbar-button" title="Refresh">
<button name="refresh" class="btn btn-primary ccp-toolbar-button" title="${this.getLabel("refresh_help")}">
<svg viewBox="0 0 48 48"><path d="M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z"/></svg>
</button>
<label name="fileupload" class="btn btn-primary ccp-toolbar-button m-0" title="Upload from file">
<label name="fileupload" class="btn btn-primary ccp-toolbar-button m-0" title="${this.getLabel("import_file_help")}">
<svg viewBox="0 96 960 960"><path d="M452 854h60V653l82 82 42-42-156-152-154 154 42 42 84-84v201ZM220 976q-24 0-42-18t-18-42V236q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554V236H220v680h520V422H551ZM220 236v186-186 680-680Z"/></svg>
<input type="file" class="d-none" multiple="multiple"/>
</label>
<div class="d-flex" style="gap:2px">
<input type="text" class="form-control" placeholder="Paste link here"/>
<button name="archive" class="btn btn-primary ccp-toolbar-button m-0" title="Upload from link">
<button name="archive" class="btn btn-primary ccp-toolbar-button m-0" title="${this.getLabel("import_link_help")}">
<svg viewBox="0 96 960 960">
<path d="M450 776H280q-83 0-141.5-58.5T80 576q0-83 58.5-141.5T280 376h170v60H280q-58.333 0-99.167 40.765-40.833 40.764-40.833 99Q140 634 180.833 675q40.834 41 99.167 41h170v60ZM324 606v-60h310v60H324Zm556-30h-60q0-58-40.833-99-40.834-41-99.167-41H510v-60h170q83 0 141.5 58.5T880 576ZM699 896V776H579v-60h120V596h60v120h120v60H759v120h-60Z"/>
</svg>
@ -232,7 +239,7 @@ class CCPExecutionHistory extends HTMLElement {
this.#archiveupload.addEventListener("click", ev=>{
const link = ev.target.parentElement.querySelector("input").value
if(link){
if(confirm("Please confirm importing of execution from link?")){
if(confirm(this.getLabel("confirm_import") + "?")){
this.fromArchiveFolder(link)
}
}
@ -499,7 +506,7 @@ class CCPExecutionHistory extends HTMLElement {
if(ev.dataTransfer && ev.dataTransfer.files && ev.dataTransfer.files.length){
const files = Array.prototype.slice.call(ev.dataTransfer.files)
const zips = files.filter(f=>f.type === "application/zip")
if(confirm("Please confirm import of execution files?")){
if(confirm(this.getLabel("confirm_import_file") + "?")){
this.importExecutions(files)
}
}
@ -560,7 +567,7 @@ class CCPExecutionHistory extends HTMLElement {
},
on_click: ev=>{
if(ev.target.getAttribute("name") === "delete"){
if(window.confirm("Please confirm deletion of this execution?")){
if(window.confirm(this.getLabel("confirm_delete_execution"))){
const id = ev.currentTarget.getAttribute("data-index")
this.deleteExecution(id)
}