This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-rocketbot-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new b578668  fix: delete duplicate calls for endpoint dependency (#544)
b578668 is described below

commit b5786682515df949fe6c2d79e61d74a68e0f8c7d
Author: Fine0830 <[email protected]>
AuthorDate: Wed Sep 29 10:34:56 2021 +0800

    fix: delete duplicate calls for endpoint dependency (#544)
---
 src/store/modules/profile/profile-store.ts |  2 +-
 src/store/modules/topology/index.ts        | 11 +++++++++--
 src/store/modules/trace/index.ts           |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/store/modules/profile/profile-store.ts 
b/src/store/modules/profile/profile-store.ts
index b62bf9b..da0813e 100644
--- a/src/store/modules/profile/profile-store.ts
+++ b/src/store/modules/profile/profile-store.ts
@@ -134,7 +134,7 @@ const actions = {
       .query('queryServices')
       .params(params)
       .then((res: AxiosResponse) => {
-        context.commit(types.SET_PROFILE_ERRORS, { msg: 'serviceErrors', desc: 
res.data.errors || '' });
+        context.commit(types.SET_PROFILE_ERRORS, { msg: 
'serviceProfileErrors', desc: res.data.errors || '' });
         if (res.data.errors) {
           return context.commit(types.SET_SERVICES, []);
         }
diff --git a/src/store/modules/topology/index.ts 
b/src/store/modules/topology/index.ts
index a5f6c65..271d454 100644
--- a/src/store/modules/topology/index.ts
+++ b/src/store/modules/topology/index.ts
@@ -580,7 +580,7 @@ const actions: ActionTree<State, any> = {
       .query('queryServices')
       .params(params)
       .then((res: AxiosResponse) => {
-        context.commit(types.SET_TOPO_ERRORS, { msg: 'serviceErrors', desc: 
res.data.errors });
+        context.commit(types.SET_TOPO_ERRORS, { msg: 'serviceTopoErrors', 
desc: res.data.errors });
         if (res.data.errors) {
           return [];
         }
@@ -773,7 +773,7 @@ const actions: ActionTree<State, any> = {
           return;
         }
         const topo = res.data.data;
-        const calls = [] as any;
+        let calls = [] as any;
         let nodes = [] as any;
         for (const key of Object.keys(topo)) {
           calls.push(...topo[key].calls);
@@ -792,6 +792,13 @@ const actions: ActionTree<State, any> = {
           }
           return prev;
         }, []);
+        calls = calls.reduce((prev: Call[], next: Call) => {
+          if (!obj[next.id]) {
+            obj[next.id] = true;
+            prev.push(next);
+          }
+          return prev;
+        }, []);
         const queryVariables = ['$duration: Duration!'];
         const fragments = calls
           .map((call: Call & EndpointDependencyConidition, index: number) => {
diff --git a/src/store/modules/trace/index.ts b/src/store/modules/trace/index.ts
index fd430d4..9aa7755 100644
--- a/src/store/modules/trace/index.ts
+++ b/src/store/modules/trace/index.ts
@@ -145,7 +145,7 @@ const actions: ActionTree<State, any> = {
       .query('queryServices')
       .params(params)
       .then((res: AxiosResponse) => {
-        context.commit(types.SET_TRACE_ERRORS, { msg: 'serviceError', desc: 
res.data.errors || '' });
+        context.commit(types.SET_TRACE_ERRORS, { msg: 'serviceTraceError', 
desc: res.data.errors || '' });
         if (res.data.errors) {
           context.commit(types.SET_SERVICES, []);
           return;

Reply via email to