You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/12/03 12:25:11 UTC

[skywalking-rocketbot-ui] branch master updated: fix: trace instance selector (#391)

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 f61a1a6  fix: trace instance selector (#391)
f61a1a6 is described below

commit f61a1a6121b308335b176b01cd848165bf7d94b9
Author: Qiuxia Fan <fi...@outlook.com>
AuthorDate: Thu Dec 3 20:25:03 2020 +0800

    fix: trace instance selector (#391)
    
    * revert: browser service
    
    * fix: trace instance selector
---
 src/store/modules/dashboard/dashboard-option.ts | 13 +++++++++++++
 src/store/modules/trace/index.ts                |  4 ----
 src/views/components/trace/trace-search.vue     |  2 ++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/store/modules/dashboard/dashboard-option.ts b/src/store/modules/dashboard/dashboard-option.ts
index 9693506..a9d680a 100644
--- a/src/store/modules/dashboard/dashboard-option.ts
+++ b/src/store/modules/dashboard/dashboard-option.ts
@@ -182,10 +182,23 @@ const actions: ActionTree<State, any> = {
           .then(() => context.dispatch('GET_SERVICE_INSTANCES', { duration: params.duration }));
       case 'database':
         return context.dispatch('GET_DATABASES', { duration: params.duration });
+      case 'browser':
+        return context
+          .dispatch('GET_BROWSER_SERVICES', { duration: params.duration, keyword: params.keywordServiceName })
+          .then(() => context.dispatch('GET_SERVICE_ENDPOINTS', {}))
+          .then(() => context.dispatch('GET_SERVICE_INSTANCES', { duration: params.duration }));
       default:
         break;
     }
   },
+  GET_BROWSER_SERVICES(context: { commit: Commit }, params: { duration: any }) {
+    return graph
+      .query('queryBrowserServices')
+      .params(params)
+      .then((res: AxiosResponse) => {
+        context.commit(types.SET_SERVICES, res.data.data.services);
+      });
+  },
   GET_ITEM_ENDPOINTS(context, params) {
     return graph
       .query('queryEndpoints')
diff --git a/src/store/modules/trace/index.ts b/src/store/modules/trace/index.ts
index 2ea5255..a3feb8d 100644
--- a/src/store/modules/trace/index.ts
+++ b/src/store/modules/trace/index.ts
@@ -52,9 +52,6 @@ const initState: State = {
   },
 };
 
-// getters
-const getters = {};
-
 // mutations
 const mutations: MutationTree<State> = {
   [types.SET_SERVICES](state: State, data: Option[]): void {
@@ -157,7 +154,6 @@ const actions: ActionTree<State, any> = {
 export default {
   namespaced: true,
   state: initState,
-  getters,
   actions,
   mutations,
 };
diff --git a/src/views/components/trace/trace-search.vue b/src/views/components/trace/trace-search.vue
index b125a98..5baf8d9 100644
--- a/src/views/components/trace/trace-search.vue
+++ b/src/views/components/trace/trace-search.vue
@@ -130,6 +130,7 @@ limitations under the License. -->
     @Action('rocketTrace/SET_TRACE_FORM') private SET_TRACE_FORM: any;
     @Mutation('rocketTrace/SET_TRACE_FORM_ITEM')
     private SET_TRACE_FORM_ITEM: any;
+    @Mutation('rocketTrace/SET_INSTANCES') private SET_INSTANCES: any;
     private service: Option = { label: 'All', key: '' };
     private time!: Date[];
     private status: boolean = true;
@@ -217,6 +218,7 @@ limitations under the License. -->
       this.instance = { label: 'All', key: '' };
       this.service = i;
       if (i.key === '') {
+        this.SET_INSTANCES([]);
         return;
       }
       this.GET_INSTANCES({ duration: this.durationTime, serviceId: i.key });