Skip to content

Commit c6f66fc

Browse files
committed
working JSONFormatter
1 parent cd0367f commit c6f66fc

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ qx.Class.define("osparc.jobs.Info", {
2424

2525
this._setLayout(new qx.ui.layout.VBox());
2626

27+
const htmlEmbed = osparc.wrapper.JsonFormatter.getInstance().createDiv();
28+
this._add(htmlEmbed, {
29+
flex: 1
30+
});
31+
this.addListener("appear", () => {
32+
osparc.wrapper.JsonFormatter.getInstance().setData(info);
33+
});
34+
35+
return;
2736
const jobInfoViewer = this.getChildControl("job-info-viewer");
2837
jobInfoViewer.setJson(info);
2938
},
@@ -43,11 +52,8 @@ qx.Class.define("osparc.jobs.Info", {
4352
switch (id) {
4453
case "job-info-viewer": {
4554
control = new osparc.ui.basic.JsonTreeViewer();
46-
/*
47-
OM remove maybe
4855
const container = new qx.ui.container.Scroll();
4956
container.add(control);
50-
*/
5157
this._add(control);
5258
break;
5359
}

services/static-webserver/client/source/class/osparc/wrapper/JsonFormatter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ qx.Class.define("osparc.wrapper.JsonFormatter", {
7878
});
7979
},
8080

81+
createDiv: function() {
82+
const htmlEmbed = new qx.ui.embed.Html("<div id='json-viewer'></div>");
83+
return htmlEmbed;
84+
},
85+
8186
setData: function(myJSON) {
8287
const formatter = new JSONFormatter(myJSON, 1); // 1 = expand depth
8388
document.getElementById("json-viewer").appendChild(formatter.render());

0 commit comments

Comments
 (0)