mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-01-18 05:50:34 +00:00
Fix result addition
This commit is contained in:
parent
6b77fdaa37
commit
14cf2c55f9
@ -206,7 +206,7 @@
|
||||
switch(operation.op) {
|
||||
case "add":
|
||||
if (pathArray[1] === "results") {
|
||||
this.setResult(operation.value);
|
||||
this.setResults([operation.value]);
|
||||
}
|
||||
break;
|
||||
case "delete":
|
||||
@ -238,30 +238,20 @@
|
||||
}
|
||||
|
||||
setResults(results) {
|
||||
let resultElement, resultsElement, resultDownloadElement,
|
||||
resultDownloadButtonElement, resultDownloadButtonIconElement,
|
||||
resultTitleElement;
|
||||
let resultsElement;
|
||||
|
||||
resultsElement = document.getElementById("results");
|
||||
|
||||
for (let result of results) {
|
||||
resultElement = document.createElement("tr");
|
||||
resultTitleElement = document.createElement("td");
|
||||
resultTitleElement.innerText = result.filename;
|
||||
resultElement.append(resultTitleElement);
|
||||
resultDownloadElement = document.createElement("td");
|
||||
resultDownloadButtonElement = document.createElement("a");
|
||||
resultDownloadButtonElement.classList.add("waves-effect", "waves-light",
|
||||
"btn-small");
|
||||
resultDownloadButtonElement.href = `/jobs/${result.job_id}/results/${result.id}/download`;
|
||||
resultDownloadButtonElement.setAttribute("download", "");
|
||||
resultDownloadButtonIconElement = document.createElement("i");
|
||||
resultDownloadButtonIconElement.classList.add("material-icons");
|
||||
resultDownloadButtonIconElement.innerText = "file_download";
|
||||
resultDownloadButtonElement.append(resultDownloadButtonIconElement);
|
||||
resultDownloadElement.append(resultDownloadButtonElement)
|
||||
resultElement.append(resultDownloadElement);
|
||||
resultsElement.append(resultElement);
|
||||
resultsElement.insertAdjacentHTML("beforeend", `
|
||||
<tr>
|
||||
<td>${result.filename}</td>
|
||||
<td>
|
||||
<a class="btn-small waves-effect waves-light" download href="/jobs/${result.job_id}/results/${result.id}/download">
|
||||
<i class="material-icons">file_download</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user