mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-11 08:30:41 +00:00
Handle user data streams different 1/2
In the future this will be much more performant!
This commit is contained in:
@ -157,9 +157,8 @@
|
||||
_init() {
|
||||
let job;
|
||||
|
||||
job = (this.foreignJobFlag ? nopaque.foreignJobs[this.jobId]
|
||||
: nopaque.jobs[this.jobId]);
|
||||
|
||||
job = (this.foreignJobFlag ? nopaque.foreignUser.jobs[this.jobId]
|
||||
: nopaque.user.jobs[this.jobId]);
|
||||
// End date
|
||||
this.setEndDate(job.end_date);
|
||||
// Status
|
||||
@ -174,8 +173,8 @@
|
||||
let pathArray;
|
||||
|
||||
for (let operation of patch) {
|
||||
/* "/jobId/valueName" -> ["jobId", "valueName"] */
|
||||
pathArray = operation.path.split("/").slice(1);
|
||||
/* "/jobs/{jobId}/..." -> ["{jobId}", ...] */
|
||||
pathArray = operation.path.split("/").slice(2);
|
||||
if (pathArray[0] != this.jobId) {continue;}
|
||||
switch(operation.op) {
|
||||
case "add":
|
||||
@ -212,20 +211,15 @@
|
||||
}
|
||||
|
||||
setResults(results) {
|
||||
let resultsElement;
|
||||
results.sort(function (a, b) {
|
||||
var filenameA = a.filename.toUpperCase();
|
||||
var filenameB = b.filename.toUpperCase();
|
||||
if (filenameA < filenameB) {
|
||||
return -1;
|
||||
}
|
||||
if (filenameA > filenameB) {
|
||||
return 1;
|
||||
}
|
||||
let resultsArray, resultsElement;
|
||||
resultsArray = Object.values(results)
|
||||
resultsArray.sort(function (a, b) {
|
||||
if (a.filename < b.filename) {return -1;}
|
||||
if (a.filename > b.filename) {return 1;}
|
||||
return 0;
|
||||
});
|
||||
resultsElement = document.getElementById("results");
|
||||
for (let result of results) {
|
||||
for (let result of resultsArray) {
|
||||
resultsElement.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
`<tr>
|
||||
|
Reference in New Issue
Block a user