fix: link addresses on hierarchy topology nodes (#361)

This commit is contained in:
Fine0830 2024-01-15 22:04:39 +08:00 committed by GitHub
parent 306508856b
commit f809123b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -51,6 +51,7 @@ export interface Node {
y?: number; y?: number;
level?: number; level?: number;
l?: number; l?: number;
key?: string;
} }
export interface ServiceHierarchy { export interface ServiceHierarchy {

View File

@ -148,7 +148,7 @@ limitations under the License. -->
popover.value.style("visibility", "hidden"); popover.value.style("visibility", "hidden");
} }
function handleNodeClick(event: MouseEvent, d: Node & { x: number; y: number }) { function handleNodeClick(event: MouseEvent, d: Node & { serviceId: string }) {
const origin = dashboardStore.entity; const origin = dashboardStore.entity;
event.stopPropagation(); event.stopPropagation();
hideTip(); hideTip();
@ -161,7 +161,7 @@ limitations under the License. -->
ConfigFieldTypes.ISDEFAULT, ConfigFieldTypes.ISDEFAULT,
).dashboard || {}; ).dashboard || {};
const name = dashboard.name; const name = dashboard.name;
const path = `/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${topologyStore.node.id}/${name}`; const path = `/dashboard/${dashboardStore.layerId}/${EntityType[3].value}/${d.serviceId}/${d.key}/${name}`;
const routeUrl = router.resolve({ path }); const routeUrl = router.resolve({ path });
window.open(routeUrl.href, "_blank"); window.open(routeUrl.href, "_blank");

View File

@ -156,7 +156,7 @@ limitations under the License. -->
popover.value.style("visibility", "hidden"); popover.value.style("visibility", "hidden");
} }
function handleNodeClick(event: MouseEvent, d: Node & { x: number; y: number }) { function handleNodeClick(event: MouseEvent, d: Node) {
const origin = dashboardStore.entity; const origin = dashboardStore.entity;
event.stopPropagation(); event.stopPropagation();
hideTip(); hideTip();
@ -169,7 +169,7 @@ limitations under the License. -->
ConfigFieldTypes.ISDEFAULT, ConfigFieldTypes.ISDEFAULT,
).dashboard || {}; ).dashboard || {};
const name = dashboard.name; const name = dashboard.name;
const path = `/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${topologyStore.node.id}/${name}`; const path = `/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${d.key}/${name}`;
const routeUrl = router.resolve({ path }); const routeUrl = router.resolve({ path });
window.open(routeUrl.href, "_blank"); window.open(routeUrl.href, "_blank");