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

qiuxiafan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git


The following commit(s) were added to refs/heads/main by this push:
     new 8e58f000 refactor: change the nodes type for Hierarchy Topology (#371)
8e58f000 is described below

commit 8e58f000a082074e42fef0105cd860300cdfb9fc
Author: Fine0830 <[email protected]>
AuthorDate: Fri Feb 2 11:50:43 2024 +0800

    refactor: change the nodes type for Hierarchy Topology (#371)
---
 src/types/topology.d.ts                                       | 3 +--
 src/views/dashboard/related/topology/pod/InstanceMap.vue      | 6 +++---
 src/views/dashboard/related/topology/service/HierarchyMap.vue | 6 +++---
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/types/topology.d.ts b/src/types/topology.d.ts
index ec7feb11..ab142ac7 100644
--- a/src/types/topology.d.ts
+++ b/src/types/topology.d.ts
@@ -37,6 +37,7 @@ export interface HierarchyNode {
   name: string;
   layer: string;
   level?: number;
+  key: string;
 }
 export interface Node {
   id: string;
@@ -51,8 +52,6 @@ export interface Node {
   y?: number;
   level?: number;
   l?: number;
-  key?: string;
-  layer?: string;
 }
 
 export interface ServiceHierarchy {
diff --git a/src/views/dashboard/related/topology/pod/InstanceMap.vue 
b/src/views/dashboard/related/topology/pod/InstanceMap.vue
index 17559b7c..f0b12857 100644
--- a/src/views/dashboard/related/topology/pod/InstanceMap.vue
+++ b/src/views/dashboard/related/topology/pod/InstanceMap.vue
@@ -34,7 +34,7 @@ limitations under the License. -->
 <script lang="ts" setup>
   import { ref, onMounted, nextTick } from "vue";
   import * as d3 from "d3";
-  import type { Node } from "@/types/topology";
+  import type { HierarchyNode } from "@/types/topology";
   import { useTopologyStore } from "@/store/modules/topology";
   import { useDashboardStore } from "@/store/modules/dashboard";
   import { EntityType, ConfigFieldTypes } from "@/views/dashboard/data";
@@ -106,7 +106,7 @@ limitations under the License. -->
     }
   }
 
-  function showNodeTip(event: MouseEvent, data: Node) {
+  function showNodeTip(event: MouseEvent, data: HierarchyNode) {
     if (!data) {
       return;
     }
@@ -148,7 +148,7 @@ limitations under the License. -->
     popover.value.style("visibility", "hidden");
   }
 
-  function handleNodeClick(event: MouseEvent, d: Node & { serviceId: string }) 
{
+  function handleNodeClick(event: MouseEvent, d: HierarchyNode & { serviceId: 
string }) {
     const origin = dashboardStore.entity;
     event.stopPropagation();
     hideTip();
diff --git a/src/views/dashboard/related/topology/service/HierarchyMap.vue 
b/src/views/dashboard/related/topology/service/HierarchyMap.vue
index ba09712c..4f0265a7 100644
--- a/src/views/dashboard/related/topology/service/HierarchyMap.vue
+++ b/src/views/dashboard/related/topology/service/HierarchyMap.vue
@@ -36,7 +36,7 @@ limitations under the License. -->
   import type { PropType } from "vue";
   import { ref, onMounted, nextTick } from "vue";
   import * as d3 from "d3";
-  import type { Node } from "@/types/topology";
+  import type { HierarchyNode } from "@/types/topology";
   import { useTopologyStore } from "@/store/modules/topology";
   import { useDashboardStore } from "@/store/modules/dashboard";
   import { EntityType, ConfigFieldTypes } from "@/views/dashboard/data";
@@ -114,7 +114,7 @@ limitations under the License. -->
     }
   }
 
-  function showNodeTip(event: MouseEvent, data: Node) {
+  function showNodeTip(event: MouseEvent, data: HierarchyNode) {
     if (!data) {
       return;
     }
@@ -156,7 +156,7 @@ limitations under the License. -->
     popover.value.style("visibility", "hidden");
   }
 
-  function handleNodeClick(event: MouseEvent, d: Node) {
+  function handleNodeClick(event: MouseEvent, d: HierarchyNode) {
     const origin = dashboardStore.entity;
     event.stopPropagation();
     hideTip();

Reply via email to