You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by qi...@apache.org on 2021/05/06 11:43:16 UTC

[skywalking-rocketbot-ui] branch master updated: fix: changing durationTime, the topology is default. (#490)

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

qiuxiafan 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 be29019  fix: changing durationTime, the topology is default. (#490)
be29019 is described below

commit be29019d76fc52eba6b0d3ec34ebf052a968b760
Author: CharliePu <he...@163.com>
AuthorDate: Thu May 6 19:43:07 2021 +0800

    fix: changing durationTime, the topology is default. (#490)
---
 src/views/components/topology/topo-services.vue | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/views/components/topology/topo-services.vue b/src/views/components/topology/topo-services.vue
index dc6191b..17c6e9b 100644
--- a/src/views/components/topology/topo-services.vue
+++ b/src/views/components/topology/topo-services.vue
@@ -38,7 +38,7 @@ limitations under the License. -->
     private group = { key: '', label: 'All groups' };
 
     private created() {
-      this.fetchData();
+      this.fetchData(true);
     }
 
     get currentServiceList() {
@@ -47,7 +47,7 @@ limitations under the License. -->
       return [{ key: '', label: 'All services' }, ...services];
     }
 
-    private fetchData() {
+    private fetchData(isDefault: boolean) {
       this.GET_SERVICES({ duration: this.durationTime }).then(
         (json: Array<{ key: string; label: string; group: string }>) => {
           const groups = [] as string[];
@@ -65,11 +65,13 @@ limitations under the License. -->
             }),
             { key: '', label: 'All groups' },
           ];
-          this.group = this.groups[0];
+          const tempGroup = isDefault ? undefined : this.groups.find((g) => g.key === this.group.key);
+          this.group = tempGroup ? tempGroup : this.groups[0];
           this.services = json;
           this.currentServices = this.currentServiceList;
-          this.service = this.currentServices[0];
-          this.renderTopo();
+          const tempService = isDefault ? undefined : this.currentServices.find((s) => s.key === this.service.key);
+          this.service = tempService ? tempService : this.currentServices[0];
+          isDefault ? this.renderTopo() : this.changeTopo();
         },
       );
     }
@@ -123,7 +125,7 @@ limitations under the License. -->
     private watchDurationTime(newValue: DurationTime, oldValue: DurationTime) {
       // Avoid repeating fetchData() after enter the component for the first time.
       if (compareObj(newValue, oldValue)) {
-        this.fetchData();
+        this.fetchData(false);
       }
     }
   }