Fine0830 commented on a change in pull request #474:
URL: 
https://github.com/apache/skywalking-rocketbot-ui/pull/474#discussion_r617283894



##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -172,24 +170,34 @@ limitations under the License. -->
         step,
       };
     }
-
     private chooseService(i: any) {
       if (this.service.key === i.key) {
         return;
       }
       this.instance = { label: 'All', key: '' };
+      this.endpoint = { label: 'All', key: '' };
       this.service = i;
       if (i.key === '') {
         this.SET_INSTANCES([]);
         return;
       }
       this.GET_INSTANCES({ duration: this.durationTime, serviceId: i.key });
+      (this.rocketTrace as any).endpoints = [];

Review comment:
       The same thing as following.

##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -15,7 +15,7 @@ limitations under the License. -->
 
 <template>
   <div class="rk-trace-search">
-    <div>
+    <div class="pb-15 pt-5">

Review comment:
       Could you set the `padding-bottom` to `5px`?

##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -172,24 +170,34 @@ limitations under the License. -->
         step,
       };
     }
-
     private chooseService(i: any) {
       if (this.service.key === i.key) {
         return;
       }
       this.instance = { label: 'All', key: '' };
+      this.endpoint = { label: 'All', key: '' };
       this.service = i;
       if (i.key === '') {
         this.SET_INSTANCES([]);
         return;
       }
       this.GET_INSTANCES({ duration: this.durationTime, serviceId: i.key });
+      (this.rocketTrace as any).endpoints = [];
+      this.GET_ITEM_ENDPOINTS({
+        serviceId: i.key,
+        keyword: '',
+        duration: this.durationTime,
+      }).then((data: Array<{ key: string; label: string }>) => {
+        (this.rocketTrace as any).endpoints = data;

Review comment:
       Please set `state` data in modules, Here is 
`src/store/modules/trace/index.ts`;

##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -172,24 +170,34 @@ limitations under the License. -->
         step,
       };
     }
-
     private chooseService(i: any) {
       if (this.service.key === i.key) {
         return;
       }
       this.instance = { label: 'All', key: '' };
+      this.endpoint = { label: 'All', key: '' };
       this.service = i;
       if (i.key === '') {
         this.SET_INSTANCES([]);
         return;
       }
       this.GET_INSTANCES({ duration: this.durationTime, serviceId: i.key });
+      (this.rocketTrace as any).endpoints = [];
+      this.GET_ITEM_ENDPOINTS({
+        serviceId: i.key,
+        keyword: '',
+        duration: this.durationTime,
+      }).then((data: Array<{ key: string; label: string }>) => {
+        (this.rocketTrace as any).endpoints = data;
+        this.$forceUpdate();
+      });
     }
-
     private chooseStatus(i: any) {
       this.traceState = i;
     }
-
+    private chooseEndpoint(i: any) {

Review comment:
       Could you use `Option` instead `any`? `import { Option } from 
'@/types/global';`

##########
File path: src/views/components/trace/trace-search.vue
##########
@@ -172,24 +170,34 @@ limitations under the License. -->
         step,
       };
     }
-
     private chooseService(i: any) {
       if (this.service.key === i.key) {
         return;
       }
       this.instance = { label: 'All', key: '' };
+      this.endpoint = { label: 'All', key: '' };
       this.service = i;
       if (i.key === '') {
         this.SET_INSTANCES([]);
         return;
       }
       this.GET_INSTANCES({ duration: this.durationTime, serviceId: i.key });
+      (this.rocketTrace as any).endpoints = [];
+      this.GET_ITEM_ENDPOINTS({
+        serviceId: i.key,
+        keyword: '',
+        duration: this.durationTime,
+      }).then((data: Array<{ key: string; label: string }>) => {
+        (this.rocketTrace as any).endpoints = data;
+        this.$forceUpdate();
+      });
     }
-
     private chooseStatus(i: any) {

Review comment:
       Could you use `Option` instead `any`? `import { Option } from 
'@/types/global';`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to