Skip to content

Commit

Permalink
Do not color message row
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Dec 5, 2024
1 parent 3ade7ef commit f3a4541
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* <pre class='javascript'>
* let tableModel = this.__logModel = new osparc.widget.logger.LoggerTable();
* tableModel.setColumns(["Timestamp", "Origin", "Message"], ["time", "who", "whatRich"]);
* tableModel.setColumns(["Level", "Time", "Origin", "Message"], ["level", "time", "who", "whatRich"]);
* let custom = {
* tableColumnModel : function(obj) {
* return new qx.ui.table.columnmodel.Resize(obj);
Expand All @@ -49,10 +49,12 @@ qx.Class.define("osparc.widget.logger.LoggerModel", {
this.base(arguments);

this.setColumns([
"",
"Time",
"Origin",
"Message"
], [
"level",
"time",
"who",
"msgRich"
Expand Down Expand Up @@ -112,7 +114,7 @@ qx.Class.define("osparc.widget.logger.LoggerModel", {

addRows: function(newRows) {
newRows.forEach(newRow => {
const levelColor = this.self().getLevelColor(newRow.logLevel);
newRow["level"] = this.self().getLevelIcon(newRow.logLevel);
newRow["time"] = osparc.utils.Utils.formatTime(newRow.timeStamp, true);
newRow["who"] = newRow.label;
newRow["msgRich"] = this.self().addColorTag(newRow.msg, levelColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,16 @@ qx.Class.define("osparc.widget.logger.LoggerView", {
// alwaysUpdateCells
osparc.utils.Utils.setIdToWidget(table, "logsViewer");
const colModel = table.getTableColumnModel();
colModel.setDataCellRenderer(this.self().POS.TIMESTAMP, new osparc.ui.table.cellrenderer.Html().set({
colModel.setDataCellRenderer(this.self().POS.LOG_LEVEL, new qx.ui.table.cellrenderer.Image());
// colModel.setDataCellRenderer(this.self().POS.LOG_LEVEL, new qx.ui.table.cellrenderer.String());
defaultCellStyle: "user-select: text"
}));
colModel.setDataCellRenderer(this.self().POS.ORIGIN, new qx.ui.table.cellrenderer.Html());
colModel.setDataCellRenderer(this.self().POS.MESSAGE, new osparc.ui.table.cellrenderer.Html().set({
defaultCellStyle: "user-select: text; text-wrap: wrap"
}));
let resizeBehavior = colModel.getBehavior();
const resizeBehavior = colModel.getBehavior();
resizeBehavior.setWidth(this.self().POS.LOG_LEVEL, 20);
resizeBehavior.setWidth(this.self().POS.TIMESTAMP, 80);
resizeBehavior.setWidth(this.self().POS.ORIGIN, 100);

Expand Down

0 comments on commit f3a4541

Please sign in to comment.