diff --git a/src/store/modules/profile.ts b/src/store/modules/profile.ts index 4fd4b200..55ac9a5b 100644 --- a/src/store/modules/profile.ts +++ b/src/store/modules/profile.ts @@ -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; }, diff --git a/src/styles/theme.scss b/src/styles/theme.scss index c6296300..4e292063 100644 --- a/src/styles/theme.scss +++ b/src/styles/theme.scss @@ -69,6 +69,7 @@ html { --sw-drawer-header: #72767b; --sw-marketplace-border: #dedfe0; --sw-grid-item-active: #d4d7de; + --sw-trace-line: #999; } html.dark { @@ -110,6 +111,7 @@ html.dark { --sw-drawer-header: #e9e9eb; --sw-marketplace-border: #606266; --sw-grid-item-active: #73767a; + --sw-trace-line: #e8e8e8; } .el-drawer__header { diff --git a/src/views/dashboard/controls/Trace.vue b/src/views/dashboard/controls/Trace.vue index 61f3907b..61b166d2 100644 --- a/src/views/dashboard/controls/Trace.vue +++ b/src/views/dashboard/controls/Trace.vue @@ -184,7 +184,7 @@ limitations under the License. --> position: relative; width: 2px; height: 100%; - background-color: #e8e8e8; + background-color: var(--sw-trace-line); cursor: ew-resize; &:hover { diff --git a/src/views/dashboard/related/profile/Header.vue b/src/views/dashboard/related/profile/Header.vue index 425b8cb7..b0d221e7 100644 --- a/src/views/dashboard/related/profile/Header.vue +++ b/src/views/dashboard/related/profile/Header.vue @@ -77,7 +77,7 @@ limitations under the License. --> ElMessage.error(res.errors); return; } - endpointName.value = profileStore.endpoints[0].value; + endpointName.value = profileStore.endpoints[0]?.value; } function changeEndpoint(opt: any[]) { diff --git a/src/views/dashboard/related/profile/components/SegmentList.vue b/src/views/dashboard/related/profile/components/SegmentList.vue index e0069ff1..03101d77 100644 --- a/src/views/dashboard/related/profile/components/SegmentList.vue +++ b/src/views/dashboard/related/profile/components/SegmentList.vue @@ -56,12 +56,7 @@ limitations under the License. --> const { t } = useI18n(); const profileStore = useProfileStore(); const key = computed( - () => - (profileStore.currentSegment && - profileStore.currentSegment.spans && - profileStore.currentSegment.spans.length && - profileStore.currentSegment.spans[0].segmentId) || - "", + () => (profileStore.currentSegment.spans?.length && profileStore.currentSegment.spans[0].segmentId) || "", ); async function selectSegment(item: Trace) { diff --git a/src/views/dashboard/related/profile/components/TaskList.vue b/src/views/dashboard/related/profile/components/TaskList.vue index 39a26249..9efc0b0f 100644 --- a/src/views/dashboard/related/profile/components/TaskList.vue +++ b/src/views/dashboard/related/profile/components/TaskList.vue @@ -14,38 +14,36 @@ See the License for the specific language governing permissions and limitations under the License. -->