Skip to content

Commit 6d38550

Browse files
committed
Jobs Browser
1 parent 29ba3fd commit 6d38550

File tree

4 files changed

+59
-4
lines changed

4 files changed

+59
-4
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2025 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
19+
qx.Class.define("osparc.jobs.JobsBrowser", {
20+
extend: qx.ui.core.Widget,
21+
22+
construct() {
23+
this.base(arguments);
24+
25+
this._setLayout(new qx.ui.layout.VBox());
26+
27+
this.getChildControl("jobs-table");
28+
},
29+
30+
statics: {
31+
popUpInWindow: function(jobsBrowser) {
32+
if (!jobsBrowser) {
33+
jobsBrowser = new osparc.jobs.JobsBrowser();
34+
}
35+
const title = qx.locale.Manager.tr("Jobs");
36+
const win = osparc.ui.window.Window.popUpInWindow(jobsBrowser, title, 500, 500);
37+
win.open();
38+
return win;
39+
}
40+
},
41+
42+
members: {
43+
_createChildControlImpl: function(id) {
44+
let control;
45+
switch (id) {
46+
case "jobs-table":
47+
control = new osparc.jobs.JobsTable();
48+
this._add(control);
49+
break;
50+
}
51+
52+
return control || this.base(arguments, id);
53+
},
54+
}
55+
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ qx.Class.define("osparc.jobs.JobsButton", {
3333

3434
const jobsStore = osparc.store.Jobs.getInstance();
3535
jobsStore.addListener("changeJobs", e => this.__updateJobsButton(), this);
36-
this.addListener("tap", () => console.log("Pop up jobs table"), this);
36+
this.addListener("tap", () => osparc.jobs.JobsBrowser.popUpInWindow(), this);
3737
},
3838

3939
members: {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
qx.Class.define("osparc.jobs.JobsTable", {
2020
extend: qx.ui.table.Table,
2121

22-
construct: function(walletId, filters) {
22+
construct: function(filters) {
2323
this.base(arguments);
2424

25-
const model = new osparc.desktop.credits.JobsTableModel(walletId, filters);
25+
const model = new osparc.jobs.JobsTableModel(filters);
2626
this.setTableModel(model);
2727

2828
this.set({

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ qx.Class.define("osparc.jobs.JobsTableModel", {
116116
jobsStore.fetchJobs(urlParams)
117117
.then(jobs => {
118118
const data = [];
119-
const jobsCols = osparc.desktop.credits.JobsTable.COLS;
119+
const jobsCols = osparc.jobs.JobsTable.COLS;
120120
jobs.forEach(job => {
121121
data.push({
122122
[jobsCols.JOB_ID.id]: job.getJobId(),

0 commit comments

Comments
 (0)