From 633bd58087b224329db7e8e0ddb0487a8e4594fc Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 3 Sep 2019 09:07:09 +0200 Subject: [PATCH] Codestyle. --- app/static/js/JobList.js | 22 ++++++++++++++------ app/templates/main/jobs/job.html.j2 | 32 +++++++++++++++++++---------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/app/static/js/JobList.js b/app/static/js/JobList.js index 03420265..d4de1fe0 100644 --- a/app/static/js/JobList.js +++ b/app/static/js/JobList.js @@ -41,8 +41,10 @@ class JobList extends List { case "status": jobStatusElement = item.elm.querySelector(".status"); status = jobStatusElement.innerHTML; - statusColor = JobList.STATUS_COLORS[status] || JobList.STATUS_COLORS['default']; - newStatusColor = JobList.STATUS_COLORS[operation.value] || JobList.STATUS_COLORS['default']; + statusColor = JobList.STATUS_COLORS[status] + || JobList.STATUS_COLORS['default']; + newStatusColor = JobList.STATUS_COLORS[operation.value] + || JobList.STATUS_COLORS['default']; jobStatusElement.classList.remove(statusColor); jobStatusElement.classList.add(newStatusColor); jobStatusElement.innerHTML = operation.value; @@ -71,12 +73,20 @@ class JobList extends List { jobElement.classList.add("avatar", "collection-item"); jobElement.dataset.id = job.id; jobElement.href = `/jobs/${job.id}`; - serviceColor = JobList.SERVICE_COLORS[job.service] || JobList.SERVICE_COLORS['default']; - serviceIcon = JobList.SERVICE_ICONS[job.service] || JobList.SERVICE_ICONS['default']; + serviceColor = JobList.SERVICE_COLORS[job.service] + || JobList.SERVICE_COLORS['default']; + serviceIcon = JobList.SERVICE_ICONS[job.service] + || JobList.SERVICE_ICONS['default']; jobServiceElement = document.createElement("i"); - jobServiceElement.classList.add("circle", "material-icons", "service-icon", serviceColor); + jobServiceElement.classList.add( + "circle", + "material-icons", + "service-icon", + serviceColor + ); jobServiceElement.innerText = serviceIcon; - statusColor = JobList.STATUS_COLORS[job.status] || JobList.STATUS_COLORS['default']; + statusColor = JobList.STATUS_COLORS[job.status] + || JobList.STATUS_COLORS['default']; jobStatusElement = document.createElement("span"); jobStatusElement.classList.add("badge", "new", "status", statusColor); jobStatusElement.dataset.badgeCaption = ""; diff --git a/app/templates/main/jobs/job.html.j2 b/app/templates/main/jobs/job.html.j2 index 4057dffb..6b02d6a9 100644 --- a/app/templates/main/jobs/job.html.j2 +++ b/app/templates/main/jobs/job.html.j2 @@ -33,7 +33,8 @@ serviceArgsElement.value = this.job.service_args; serviceVersionElement = document.getElementById("service-version"); serviceVersionElement.value = this.job.service_version; - statusColor = JobList.STATUS_COLORS[this.job.status] || JobList.STATUS_COLORS['default']; + statusColor = JobList.STATUS_COLORS[this.job.status] + || JobList.STATUS_COLORS['default']; statusElement = document.getElementById("status"); statusElement.classList.add(statusColor); statusElement.innerHTML = this.job.status; @@ -69,10 +70,15 @@ M.updateTextFields(); break; case "status": + if (operation.value == "complete") { + location.reload(); + } updatedElement = document.getElementById("status"); status = updatedElement.innerHTML; - statusColor = JobList.STATUS_COLORS[status] || JobList.STATUS_COLORS['default']; - newStatusColor = JobList.STATUS_COLORS[operation.value] || JobList.STATUS_COLORS['default']; + statusColor = JobList.STATUS_COLORS[status] + || JobList.STATUS_COLORS['default']; + newStatusColor = JobList.STATUS_COLORS[operation.value] + || JobList.STATUS_COLORS['default']; updatedElement.classList.remove(statusColor); updatedElement.classList.add(newStatusColor); updatedElement.innerHTML = operation.value; @@ -119,6 +125,7 @@ + Ressource allocations
@@ -134,6 +141,7 @@
+ Service informations
@@ -155,11 +163,13 @@
+ + Input files

{% for file in files %} - - file_download{{ file }} - + + file_download{{ file }} + {% endfor %}

@@ -167,13 +177,13 @@

 

Results

- {% for file in files %} + {% for file in files %} {% for result in files[file]['results'] %} - - file_download{{ result }} - + + file_download{{ result }} + + {% endfor %} {% endfor %} - {% endfor %}

{% endif %}