diff --git a/rust/template/ddlog_profiler/profiler_ui/ui.js b/rust/template/ddlog_profiler/profiler_ui/ui.js index 46137d23f..251aff7ce 100644 --- a/rust/template/ddlog_profiler/profiler_ui/ui.js +++ b/rust/template/ddlog_profiler/profiler_ui/ui.js @@ -339,9 +339,13 @@ var ProfileTable = /** @class */ (function () { this.tbody = this.table.createTBody(); } ProfileTable.prototype.getId = function (row) { - if (row.opid == null) - return null; - return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + row.opid.toString(); + var id = row.opid; + var ids; + if (id == null) + ids = "0"; + else + ids = id.toString(); + return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + ids; }; ProfileTable.prototype.addDataRow = function (indent, rowIndex, row, lastInSequence, histogramStart) { var _this = this; @@ -355,7 +359,7 @@ var ProfileTable = /** @class */ (function () { children: row.children === undefined ? [] : row.children, dd_op: row.dd_op === undefined ? "" : row.dd_op, invocations: row.invocations === undefined ? -1 : row.invocations, - opid: row.opid === undefined ? -1 : row.opid, + opid: row.opid === undefined ? 0 : row.opid, short_descr: row.short_descr === undefined ? "" : row.short_descr }; var id = this.getId(safeRow); @@ -568,8 +572,6 @@ var ProfileTable = /** @class */ (function () { }; ProfileTable.prototype.findPathFromRow = function (r, id) { var thisId = this.getId(r); - if (thisId == null) - return null; if (thisId == id) { return [thisId]; } diff --git a/rust/template/ddlog_profiler/profiler_ui/ui.ts b/rust/template/ddlog_profiler/profiler_ui/ui.ts index 9dfc964fe..2802610c0 100644 --- a/rust/template/ddlog_profiler/profiler_ui/ui.ts +++ b/rust/template/ddlog_profiler/profiler_ui/ui.ts @@ -422,10 +422,14 @@ class ProfileTable implements IHtmlElement { this.tbody = this.table.createTBody(); } - protected getId(row: Partial): string | null { - if (row.opid == null) - return null; - return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + row.opid.toString(); + protected getId(row: Partial): string { + let id = row.opid; + let ids; + if (id == null) + ids = "0"; + else + ids = id.toString(); + return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + ids; } protected addDataRow(indent: number, rowIndex: number, row: Partial, @@ -440,7 +444,7 @@ class ProfileTable implements IHtmlElement { children: row.children === undefined ? [] : row.children, dd_op: row.dd_op === undefined ? "" : row.dd_op, invocations: row.invocations === undefined ? -1 : row.invocations, - opid: row.opid === undefined ? -1 : row.opid, + opid: row.opid === undefined ? 0 : row.opid, short_descr: row.short_descr === undefined ? "" : row.short_descr }; @@ -651,8 +655,6 @@ class ProfileTable implements IHtmlElement { protected findPathFromRow(r: Partial, id: string): string[] | null { let thisId = this.getId(r); - if (thisId == null) - return null; if (thisId == id) { return [thisId]; }