mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 13:04:42 +00:00
refactor: change the nodes type for Hierarchy Topology (#371)
This commit is contained in:
parent
931cea4c4c
commit
8e58f000a0
3
src/types/topology.d.ts
vendored
3
src/types/topology.d.ts
vendored
@ -37,6 +37,7 @@ export interface HierarchyNode {
|
|||||||
name: string;
|
name: string;
|
||||||
layer: string;
|
layer: string;
|
||||||
level?: number;
|
level?: number;
|
||||||
|
key: string;
|
||||||
}
|
}
|
||||||
export interface Node {
|
export interface Node {
|
||||||
id: string;
|
id: string;
|
||||||
@ -51,8 +52,6 @@ export interface Node {
|
|||||||
y?: number;
|
y?: number;
|
||||||
level?: number;
|
level?: number;
|
||||||
l?: number;
|
l?: number;
|
||||||
key?: string;
|
|
||||||
layer?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ServiceHierarchy {
|
export interface ServiceHierarchy {
|
||||||
|
@ -34,7 +34,7 @@ limitations under the License. -->
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, nextTick } from "vue";
|
import { ref, onMounted, nextTick } from "vue";
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
import type { Node } from "@/types/topology";
|
import type { HierarchyNode } from "@/types/topology";
|
||||||
import { useTopologyStore } from "@/store/modules/topology";
|
import { useTopologyStore } from "@/store/modules/topology";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { EntityType, ConfigFieldTypes } from "@/views/dashboard/data";
|
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) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ limitations under the License. -->
|
|||||||
popover.value.style("visibility", "hidden");
|
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;
|
const origin = dashboardStore.entity;
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
hideTip();
|
hideTip();
|
||||||
|
@ -36,7 +36,7 @@ limitations under the License. -->
|
|||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { ref, onMounted, nextTick } from "vue";
|
import { ref, onMounted, nextTick } from "vue";
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
import type { Node } from "@/types/topology";
|
import type { HierarchyNode } from "@/types/topology";
|
||||||
import { useTopologyStore } from "@/store/modules/topology";
|
import { useTopologyStore } from "@/store/modules/topology";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { EntityType, ConfigFieldTypes } from "@/views/dashboard/data";
|
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) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ limitations under the License. -->
|
|||||||
popover.value.style("visibility", "hidden");
|
popover.value.style("visibility", "hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNodeClick(event: MouseEvent, d: Node) {
|
function handleNodeClick(event: MouseEvent, d: HierarchyNode) {
|
||||||
const origin = dashboardStore.entity;
|
const origin = dashboardStore.entity;
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
hideTip();
|
hideTip();
|
||||||
|
Loading…
Reference in New Issue
Block a user