From bd43b92516327a2ea8f73a5a748e084ffd6bb786 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Tue, 1 Mar 2022 14:50:10 +0800 Subject: [PATCH] feat: add span tree --- src/assets/icons/library_books.svg | 17 ++ src/store/modules/dashboard.ts | 2 +- src/store/modules/profile.ts | 5 +- src/styles/lib.scss | 4 + src/views/dashboard/data.ts | 4 + .../dashboard/related/profile/Content.vue | 22 ++- .../profile/components/SegmentList.vue | 9 +- .../related/profile/components/SpanTree.vue | 161 ++++++++++++++- .../related/profile/components/TaskList.vue | 183 +++++++++++++----- 9 files changed, 342 insertions(+), 65 deletions(-) create mode 100644 src/assets/icons/library_books.svg diff --git a/src/assets/icons/library_books.svg b/src/assets/icons/library_books.svg new file mode 100644 index 00000000..1fac0f64 --- /dev/null +++ b/src/assets/icons/library_books.svg @@ -0,0 +1,17 @@ + + + + diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 8c60f27f..24a19e33 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -96,7 +96,7 @@ export const dashboardStore = defineStore({ }; } if (type === "Trace" || type === "Profile") { - newItem.h = 24; + newItem.h = 36; } this.layout = this.layout.map((d: LayoutConfig) => { d.y = d.y + newItem.h; diff --git a/src/store/modules/profile.ts b/src/store/modules/profile.ts index 60a9e26c..b9b20a73 100644 --- a/src/store/modules/profile.ts +++ b/src/store/modules/profile.ts @@ -23,7 +23,7 @@ import { ProfileAnalyzationTrees, TaskLog, } from "@/types/profile"; -import { Trace } from "@/types/trace"; +import { Trace, Span } from "@/types/trace"; import { store } from "@/store"; import graphql from "@/graphql"; import { AxiosResponse } from "axios"; @@ -63,6 +63,9 @@ export const traceStore = defineStore({ ...data, }; }, + setCurrentSpan(span: Span) { + this.currentSpan = span; + }, setCurrentSegment(s: Trace) { this.currentSegment = s; }, diff --git a/src/styles/lib.scss b/src/styles/lib.scss index f6aecaed..3462512e 100644 --- a/src/styles/lib.scss +++ b/src/styles/lib.scss @@ -30,6 +30,10 @@ overflow: hidden; } +.wba { + word-break: break-all; +} + .cp { cursor: pointer; } diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index 9880fa95..cc1b62b2 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -214,3 +214,7 @@ export const QueryOrders = [ { label: "duration", value: "BY_DURATION" }, ]; export const TraceEntitys = ["All", "Service", "ServiceInstance", "Endpoint"]; +export const ProfileMode: any[] = [ + { label: "Include Children", value: "include" }, + { label: "Exclude Children", value: "exclude" }, +]; diff --git a/src/views/dashboard/related/profile/Content.vue b/src/views/dashboard/related/profile/Content.vue index e2ab0a87..e756b15d 100644 --- a/src/views/dashboard/related/profile/Content.vue +++ b/src/views/dashboard/related/profile/Content.vue @@ -13,12 +13,12 @@ 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. -->