refactor: polish Trace Profiling widget (#436)

This commit is contained in:
Fine0830
2024-12-02 15:10:24 +08:00
committed by GitHub
parent 99a2461734
commit 8771ce4a19
6 changed files with 38 additions and 44 deletions

View File

@@ -80,7 +80,7 @@ export const profileStore = defineStore({
this.analyzeTrees = [];
},
setCurrentSegment(segment: Trace) {
this.currentSegment = segment;
this.currentSegment = segment || {};
this.segmentSpans = segment.spans || [];
if (segment.spans) {
this.currentSpan = segment.spans[0] || {};
@@ -155,10 +155,10 @@ export const profileStore = defineStore({
return res.data;
}
if (segmentList[0]) {
this.currentSegment = segmentList[0];
this.setCurrentSegment(segmentList[0]);
this.getSegmentSpans(segmentList[0].segmentId);
} else {
this.currentSegment = {};
this.setCurrentSegment({});
}
return res.data;
},