diff --git a/src/graphql/index.ts b/src/graphql/index.ts index 78b1a5c8..c735dc4f 100644 --- a/src/graphql/index.ts +++ b/src/graphql/index.ts @@ -22,6 +22,7 @@ import * as dashboard from "./query/dashboard"; import * as topology from "./query/topology"; import * as trace from "./query/trace"; import * as log from "./query/log"; +import * as profile from "./query/profile"; const query: { [key: string]: string } = { ...app, @@ -30,6 +31,7 @@ const query: { [key: string]: string } = { ...topology, ...trace, ...log, + ...profile, }; class Graphql { private queryData = ""; diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index ed445ec9..29feac0c 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -93,6 +93,8 @@ const msg = { default: "Default", topSlow: "Top 5 of slow", topChildren: "Top 5 of children", + taskList: "Task List", + sampledTraces: "Sampled Traces", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index d7938640..5764eeed 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -93,6 +93,8 @@ const msg = { topSlow: "迟缓的前5名", topChildren: "小孩数量的前5名", showDepth: "展示深度选择器", + taskList: "任务列表", + sampledTraces: "采样的追踪", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", diff --git a/src/store/modules/profile.ts b/src/store/modules/profile.ts index 5a3db670..60a9e26c 100644 --- a/src/store/modules/profile.ts +++ b/src/store/modules/profile.ts @@ -35,9 +35,9 @@ interface ProfileState { condition: { serviceId: string; endpointName: string }; taskList: TaskListItem[]; segmentList: Trace[]; - currentSegment: Nullable; + currentSegment: Trace | Record; segmentSpans: SegmentSpan[]; - currentSpan: Nullable; + currentSpan: SegmentSpan | Record; analyzeTrees: ProfileAnalyzationTrees; taskLogs: TaskLog[]; } @@ -50,9 +50,9 @@ export const traceStore = defineStore({ condition: { serviceId: "", endpointName: "" }, taskList: [], segmentList: [], - currentSegment: null, + currentSegment: {}, segmentSpans: [], - currentSpan: null, + currentSpan: {}, analyzeTrees: [], taskLogs: [], }), @@ -63,6 +63,9 @@ export const traceStore = defineStore({ ...data, }; }, + setCurrentSegment(s: Trace) { + this.currentSegment = s; + }, async getServices(layer: string) { const res: AxiosResponse = await graphql.query("queryServices").params({ layer, @@ -89,6 +92,8 @@ export const traceStore = defineStore({ if (!list.length) { return res.data; } + this.getSegmentList({ taskID: list[0].id }); + return res.data; }, async getSegmentList(params: { taskID: string }) { const res: AxiosResponse = await graphql @@ -105,6 +110,7 @@ export const traceStore = defineStore({ if (segmentList[0]) { this.currentSegment = segmentList[0]; + this.getSegmentSpans({ segmentId: segmentList[0].segmentId }); } else { this.currentSegment = null; } diff --git a/src/types/trace.d.ts b/src/types/trace.d.ts index 7bd2682f..82e0f669 100644 --- a/src/types/trace.d.ts +++ b/src/types/trace.d.ts @@ -22,6 +22,7 @@ export interface Trace { operationNames: string[]; start: string; traceIds: Array; + segmentId: string; } export interface Span { diff --git a/src/views/dashboard/controls/Profile.vue b/src/views/dashboard/controls/Profile.vue index 4f2fbbd5..7a8eb824 100644 --- a/src/views/dashboard/controls/Profile.vue +++ b/src/views/dashboard/controls/Profile.vue @@ -24,13 +24,16 @@ limitations under the License. --> {{ t("delete") }} -
header
+
+ diff --git a/src/views/dashboard/related/profile/Header.vue b/src/views/dashboard/related/profile/Header.vue index aca7b2b1..ab87537c 100644 --- a/src/views/dashboard/related/profile/Header.vue +++ b/src/views/dashboard/related/profile/Header.vue @@ -13,8 +13,8 @@ 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. -->