Skip to content

Commit cc39821

Browse files
committed
JobInfo
1 parent 58d4355 commit cc39821

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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.JobInfo", {
20+
extend: qx.ui.core.Widget,
21+
22+
construct(jobId) {
23+
this.base(arguments);
24+
25+
this._setLayout(new qx.ui.layout.VBox());
26+
27+
const jobInfoViewer = this.getChildControl("job-info-viewer");
28+
osparc.store.Jobs.getInstance().fetchJobInfo(jobId)
29+
.then(info => {
30+
jobInfoViewer.setJson(info);
31+
});
32+
},
33+
34+
statics: {
35+
popUpInWindow: function(jobInfo) {
36+
const title = qx.locale.Manager.tr("Job Info");
37+
const win = osparc.ui.window.Window.popUpInWindow(jobInfo, title, 600, 400);
38+
win.open();
39+
return win;
40+
}
41+
},
42+
43+
members: {
44+
_createChildControlImpl: function(id) {
45+
let control;
46+
switch (id) {
47+
case "job-info-viewer": {
48+
control = new osparc.ui.basic.JsonTreeWidget();
49+
const container = new qx.ui.container.Scroll();
50+
container.add(control);
51+
this._add(container);
52+
break;
53+
}
54+
}
55+
56+
return control || this.base(arguments, id);
57+
},
58+
}
59+
})

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ qx.Class.define("osparc.jobs.JobsTable", {
143143
__handleButtonClick: function(action, row) {
144144
const rowData = this.getTableModel().getRowData(row);
145145
switch (action) {
146-
case "info":
147-
console.log(`Info row ${row}`);
146+
case "info": {
147+
const jobInfo = new osparc.jobs.JobInfo(rowData["jobId"]);
148+
osparc.jobs.JobInfo.popUpInWindow(jobInfo);
148149
break;
150+
}
149151
case "stop":
150152
case "delete":
151153
case "logs": {

0 commit comments

Comments
 (0)