diff --git a/package.json b/package.json index ba51e014..a097b797 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,8 @@ "@typescript-eslint/explicit-function-return-type": "off", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-non-null-assertion": "off" + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-this-alias": "off" }, "overrides": [ { diff --git a/src/assets/icons/issue-open-m.svg b/src/assets/icons/issue-open-m.svg new file mode 100755 index 00000000..dcbf2051 --- /dev/null +++ b/src/assets/icons/issue-open-m.svg @@ -0,0 +1,16 @@ + + +icn/issue-open-m \ No newline at end of file diff --git a/src/views/dashboard/related/trace/Detail.vue b/src/views/dashboard/related/trace/Detail.vue index 0371c003..bbacaeb1 100644 --- a/src/views/dashboard/related/trace/Detail.vue +++ b/src/views/dashboard/related/trace/Detail.vue @@ -11,92 +11,96 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> diff --git a/src/views/dashboard/related/trace/components/utils/d3-trace.ts b/src/views/dashboard/related/trace/components/utils/d3-trace.ts index 253b1909..bdd224e3 100644 --- a/src/views/dashboard/related/trace/components/utils/d3-trace.ts +++ b/src/views/dashboard/related/trace/components/utils/d3-trace.ts @@ -18,6 +18,7 @@ import * as d3 from "d3"; import d3tip from "d3-tip"; import { Span, Trace } from "@/types/trace"; +import { func } from "vue-types"; const type = { MQ: "#bf99f8", @@ -49,7 +50,7 @@ export default class ListGraph { constructor(el: HTMLDivElement, handleSelectSpan: (i: Trace) => void) { this.handleSelectSpan = handleSelectSpan; this.el = el; - this.width = el.clientWidth; + this.width = el.clientWidth - 20; this.height = el.clientHeight; this.svg = d3 .select(this.el) @@ -61,23 +62,23 @@ export default class ListGraph { this.tip = (d3tip as any)() .attr("class", "d3-tip") .offset([-8, 0]) - .html( - (d: any) => ` -
${d.data.label}
- ${ - d.data.dur - ? '
SelfDuration: ' + d.data.dur + "ms
" - : "" - } - ${ - d.data.endTime - d.data.startTime - ? '
TotalDuration: ' + - (d.data.endTime - d.data.startTime) + - "ms
" - : "" - } - ` - ); + .html((d: any) => { + return ` +
${d.data.label}
+ ${ + d.data.dur + ? '
SelfDuration: ' + d.data.dur + "ms
" + : "" + } + ${ + d.data.endTime - d.data.startTime + ? '
TotalDuration: ' + + (d.data.endTime - d.data.startTime) + + "ms
" + : "" + } + `; + }); this.svg.call(this.tip); } diagonal(d: any) { @@ -135,6 +136,7 @@ export default class ListGraph { scope.update(d); } update(source: any, callback: any) { + const t = this; const nodes = this.root.descendants(); let index = -1; this.root.eachBefore((n: any) => { @@ -150,11 +152,11 @@ export default class ListGraph { .attr("transform", `translate(${source.y0},${source.x0})`) .attr("class", "trace-node") .style("opacity", 0) - .on("mouseover", (d: Trace) => { - this.tip.show(d, this); + .on("mouseover", function (event: any, d: Trace) { + t.tip.show(d, this); }) - .on("mouseout", (d: Trace) => { - this.tip.hide(d, this); + .on("mouseout", function (event: any, d: Trace) { + t.tip.hide(d, this); }) .on("click", (d: Trace) => { if (this.handleSelectSpan) {