Skip to content

Commit 1eaa1fe

Browse files
committed
runs adapted
1 parent 4e6892b commit 1eaa1fe

File tree

6 files changed

+52
-23
lines changed

6 files changed

+52
-23
lines changed

services/static-webserver/client/source/class/osparc/data/Job.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ qx.Class.define("osparc.data.Job", {
2222
this.base(arguments);
2323

2424
this.set({
25-
projectUuid: jobData["projectUuid"],
26-
projectName: jobData["rootProjectName"] || "",
25+
collectionRunId: jobData["collectionRunId"],
26+
projectIds: jobData["projectIds"],
27+
name: jobData["name"] || "",
2728
state: jobData["state"] || "UNKNOWN",
2829
submittedAt: jobData["submittedAt"] ? new Date(jobData["submittedAt"]) : null,
2930
startedAt: jobData["startedAt"] ? new Date(jobData["startedAt"]) : null,
@@ -36,13 +37,19 @@ qx.Class.define("osparc.data.Job", {
3637
},
3738

3839
properties: {
39-
projectUuid: {
40+
collectionRunId: {
4041
check: "String",
4142
nullable: false,
4243
init: null,
4344
},
4445

45-
projectName: {
46+
projectIds: {
47+
check: "Array",
48+
nullable: false,
49+
init: null,
50+
},
51+
52+
name: {
4653
check: "String",
4754
nullable: false,
4855
init: null,

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,20 @@ qx.Class.define("osparc.data.Resources", {
363363
},
364364
}
365365
},
366+
"runs": {
367+
useCache: false, // handled in osparc.store.Jobs
368+
endpoints: {
369+
getPageLatest: {
370+
method: "GET",
371+
// url: statics.API + "/computation-collection-runs?offset={offset}&limit={limit}&order_by={orderBy}&filter_only_running={runningOnly}"
372+
url: statics.API + "/computation-collection-runs?offset={offset}&limit={limit}&order_by={orderBy}&filter_only_running=false"
373+
},
374+
getPageHistory: {
375+
method: "GET",
376+
url: statics.API + "/computation-collection-runs?offset={offset}&limit={limit}&order_by={orderBy}&filter_by_root_project_id={studyId}"
377+
},
378+
}
379+
},
366380
"runsOld": {
367381
useCache: false, // handled in osparc.store.Jobs
368382
endpoints: {

services/static-webserver/client/source/class/osparc/jobs/ActivityOverview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ qx.Class.define("osparc.jobs.ActivityOverview", {
111111
const runsTable = this.__runsTable = new osparc.jobs.RunsTable(projectUuid, includeChildren, runningOnly);
112112
const columnModel = runsTable.getTableColumnModel();
113113
// Hide project name column
114-
columnModel.setColumnVisible(osparc.jobs.RunsTable.COLS.PROJECT_NAME.column, false);
114+
columnModel.setColumnVisible(osparc.jobs.RunsTable.COLS.NAME.column, false);
115115
// Hide cancel column
116116
columnModel.setColumnVisible(osparc.jobs.RunsTable.COLS.ACTION_CANCEL.column, false);
117117
runsHistoryLayout.add(runsTable, {

services/static-webserver/client/source/class/osparc/jobs/RunsTable.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ qx.Class.define("osparc.jobs.RunsTable", {
3939
});
4040

4141
const columnModel = this.getTableColumnModel();
42-
columnModel.setColumnVisible(this.self().COLS.PROJECT_UUID.column, false);
42+
columnModel.setColumnVisible(this.self().COLS.COLLECTION_RUN_ID.column, false);
43+
columnModel.setColumnVisible(this.self().COLS.PROJECT_IDS.column, false);
4344

4445
Object.values(this.self().COLS).forEach(col => columnModel.setColumnWidth(col.column, col.width));
4546

@@ -76,54 +77,60 @@ qx.Class.define("osparc.jobs.RunsTable", {
7677

7778
statics: {
7879
COLS: {
79-
PROJECT_UUID: {
80-
id: "projectUuid",
80+
COLLECTION_RUN_ID: {
81+
id: "collectionRunId",
8182
column: 0,
82-
label: qx.locale.Manager.tr("Project Id"),
83+
label: qx.locale.Manager.tr("Collection Run Id"),
8384
width: 200
8485
},
85-
PROJECT_NAME: {
86-
id: "projectName",
86+
PROJECT_IDS: {
87+
id: "projectUuid",
8788
column: 1,
88-
label: qx.locale.Manager.tr("Project"),
89+
label: qx.locale.Manager.tr("Project Ids"),
90+
width: 200
91+
},
92+
NAME: {
93+
id: "name",
94+
column: 2,
95+
label: qx.locale.Manager.tr("Name"),
8996
width: 150,
9097
},
9198
STATE: {
9299
id: "state",
93-
column: 2,
100+
column: 3,
94101
label: qx.locale.Manager.tr("Status"),
95102
width: 150,
96103
},
97104
SUBMIT: {
98105
id: "submit",
99-
column: 3,
106+
column: 4,
100107
label: qx.locale.Manager.tr("Queued"),
101108
width: 130,
102109
sortableMap: "submitted_at",
103110
},
104111
START: {
105112
id: "start",
106-
column: 4,
113+
column: 5,
107114
label: qx.locale.Manager.tr("Started"),
108115
width: 130,
109116
sortableMap: "started_at",
110117
},
111118
END: {
112119
id: "end",
113-
column: 5,
120+
column: 6,
114121
label: qx.locale.Manager.tr("Ended"),
115122
width: 130,
116123
sortableMap: "ended_at",
117124
},
118125
ACTION_CANCEL: {
119126
id: "action_cancel",
120-
column: 6,
127+
column: 7,
121128
label: qx.locale.Manager.tr("Cancel"),
122129
width: 50
123130
},
124131
ACTION_INFO: {
125132
id: "action_info",
126-
column: 7,
133+
column: 8,
127134
label: qx.locale.Manager.tr("Info"),
128135
width: 50
129136
},

services/static-webserver/client/source/class/osparc/jobs/RunsTableModel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ qx.Class.define("osparc.jobs.RunsTableModel", {
136136
const jobsCols = osparc.jobs.RunsTable.COLS;
137137
jobs.forEach(job => {
138138
data.push({
139-
[jobsCols.PROJECT_UUID.id]: job.getProjectUuid(),
140-
[jobsCols.PROJECT_NAME.id]: job.getProjectName(),
139+
[jobsCols.COLLECTION_RUN_ID.id]: job.getCollectionRunId(),
140+
[jobsCols.PROJECT_IDS.id]: job.getProjectIds().join(", "),
141+
[jobsCols.NAME.id]: job.getName(),
141142
[jobsCols.STATE.id]: osparc.data.Job.STATUS_LABELS[job.getState()] || job.getState(),
142143
[jobsCols.SUBMIT.id]: job.getSubmittedAt() ? osparc.utils.Utils.formatDateAndTime(job.getSubmittedAt()) : "-",
143144
[jobsCols.START.id]: job.getStartedAt() ? osparc.utils.Utils.formatDateAndTime(job.getStartedAt()) : "-",

services/static-webserver/client/source/class/osparc/store/Jobs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ qx.Class.define("osparc.store.Jobs", {
5656
const options = {
5757
resolveWResponse: true
5858
};
59-
return osparc.data.Resources.fetch("runsOld", "getPageLatest", params, options)
59+
return osparc.data.Resources.fetch("runs", "getPageLatest", params, options)
6060
.then(jobsResp => {
6161
const jobsActive = [];
6262
if ("data" in jobsResp) {
@@ -95,7 +95,7 @@ qx.Class.define("osparc.store.Jobs", {
9595
const options = {
9696
resolveWResponse: true
9797
};
98-
return osparc.data.Resources.fetch("runsOld", "getPageHistory", params, options)
98+
return osparc.data.Resources.fetch("runs", "getPageHistory", params, options)
9999
.then(jobsResp => {
100100
if (resolveWResponse) {
101101
return jobsResp;
@@ -139,7 +139,7 @@ qx.Class.define("osparc.store.Jobs", {
139139

140140
__addJob: function(jobData) {
141141
const jobs = this.getJobs();
142-
const jobFound = jobs.find(job => job.getProjectUuid() === jobData["projectUuid"]);
142+
const jobFound = jobs.find(job => job.getCollectionRunId() === jobData["collectionRunId"]);
143143
if (jobFound) {
144144
jobFound.updateJob(jobData);
145145
return jobFound;

0 commit comments

Comments
 (0)