diff --git a/awx/ui/src/screens/TopologyView/MeshGraph.js b/awx/ui/src/screens/TopologyView/MeshGraph.js
index 52747d0a81..77ca7656f4 100644
--- a/awx/ui/src/screens/TopologyView/MeshGraph.js
+++ b/awx/ui/src/screens/TopologyView/MeshGraph.js
@@ -1,102 +1,102 @@
import React, { useEffect, useCallback } from 'react';
-import { t } from '@lingui/macro';
+// import { t } from '@lingui/macro';
import * as d3 from 'd3';
-// function MeshGraph({ data }) {
-function MeshGraph() {
- const data = {
- nodes: [
- {
- hostname: "aapc1.local",
- node_state: "healthy",
- node_type: "control",
- id: 1
- },
- {
- hostname: "aapc2.local",
- node_type: "control",
- node_state: "disabled",
- id: 2
- },
- {
- hostname: "aapc3.local",
- node_type: "control",
- node_state: "healthy",
- id: 3
- },
- {
- hostname: "aape1.local",
- node_type: "execution",
- node_state: "error",
- id: 4
- },
- {
- hostname: "aape2.local",
- node_type: "execution",
- node_state: "error",
- id: 5
- },
- {
- hostname: "aape3.local",
- node_type: "execution",
- node_state: "healthy",
- id: 6
- },
- {
- hostname: "aape4.local",
- node_type: "execution",
- node_state: "healthy",
- id: 7
- },
- {
- hostname: "aaph1.local",
- node_type: "hop",
- node_state: "disabled",
- id: 8
- },
- {
- hostname: "aaph2.local",
- node_type: "hop",
- node_state: "healthy",
- id: 9
- },
- {
- hostname: "aaph3.local",
- node_type: "hop",
- node_state: "error",
- id: 10
- }
- ],
- links: [
- { source: "aapc1.local", target: "aapc2.local" },
- { source: "aapc1.local", target: "aapc3.local" },
- { source: "aapc1.local", target: "aape1.local" },
- { source: "aapc1.local", target: "aape2.local" },
+function MeshGraph({ data }) {
+ // function MeshGraph() {
+ // const data = {
+ // nodes: [
+ // {
+ // hostname: 'aapc1.local',
+ // node_state: 'healthy',
+ // node_type: 'control',
+ // id: 1,
+ // },
+ // {
+ // hostname: 'aapc2.local',
+ // node_type: 'control',
+ // node_state: 'disabled',
+ // id: 2,
+ // },
+ // {
+ // hostname: 'aapc3.local',
+ // node_type: 'control',
+ // node_state: 'healthy',
+ // id: 3,
+ // },
+ // {
+ // hostname: 'aape1.local',
+ // node_type: 'execution',
+ // node_state: 'error',
+ // id: 4,
+ // },
+ // {
+ // hostname: 'aape2.local',
+ // node_type: 'execution',
+ // node_state: 'error',
+ // id: 5,
+ // },
+ // {
+ // hostname: 'aape3.local',
+ // node_type: 'execution',
+ // node_state: 'healthy',
+ // id: 6,
+ // },
+ // {
+ // hostname: 'aape4.local',
+ // node_type: 'execution',
+ // node_state: 'healthy',
+ // id: 7,
+ // },
+ // {
+ // hostname: 'aaph1.local',
+ // node_type: 'hop',
+ // node_state: 'disabled',
+ // id: 8,
+ // },
+ // {
+ // hostname: 'aaph2.local',
+ // node_type: 'hop',
+ // node_state: 'healthy',
+ // id: 9,
+ // },
+ // {
+ // hostname: 'aaph3.local',
+ // node_type: 'hop',
+ // node_state: 'error',
+ // id: 10,
+ // },
+ // ],
+ // links: [
+ // { source: 'aapc1.local', target: 'aapc2.local' },
+ // { source: 'aapc1.local', target: 'aapc3.local' },
+ // { source: 'aapc1.local', target: 'aape1.local' },
+ // { source: 'aapc1.local', target: 'aape2.local' },
- { source: "aapc2.local", target: "aapc3.local" },
- { source: "aapc2.local", target: "aape1.local" },
- { source: "aapc2.local", target: "aape2.local" },
+ // { source: 'aapc2.local', target: 'aapc3.local' },
+ // { source: 'aapc2.local', target: 'aape1.local' },
+ // { source: 'aapc2.local', target: 'aape2.local' },
- { source: "aapc3.local", target: "aape1.local" },
- { source: "aapc3.local", target: "aape2.local" },
+ // { source: 'aapc3.local', target: 'aape1.local' },
+ // { source: 'aapc3.local', target: 'aape2.local' },
- { source: "aape3.local", target: "aaph1.local" },
- { source: "aape3.local", target: "aaph2.local" },
+ // { source: 'aape3.local', target: 'aaph1.local' },
+ // { source: 'aape3.local', target: 'aaph2.local' },
- { source: "aape4.local", target: "aaph3.local" },
+ // { source: 'aape4.local', target: 'aaph3.local' },
- { source: "aaph1.local", target: "aapc1.local" },
- { source: "aaph1.local", target: "aapc2.local" },
- { source: "aaph1.local", target: "aapc3.local" },
+ // { source: 'aaph1.local', target: 'aapc1.local' },
+ // { source: 'aaph1.local', target: 'aapc2.local' },
+ // { source: 'aaph1.local', target: 'aapc3.local' },
- { source: "aaph2.local", target: "aapc1.local" },
- { source: "aaph2.local", target: "aapc2.local" },
- { source: "aaph2.local", target: "aapc3.local" },
+ // { source: 'aaph2.local', target: 'aapc1.local' },
+ // { source: 'aaph2.local', target: 'aapc2.local' },
+ // { source: 'aaph2.local', target: 'aapc3.local' },
- { source: "aaph3.local", target: "aaph1.local" },
- { source: "aaph3.local", target: "aaph2.local" }
- ]
- };
+ // { source: 'aaph3.local', target: 'aaph1.local' },
+ // { source: 'aaph3.local', target: 'aaph2.local' },
+ // ],
+ // };
const draw = useCallback(() => {
const margin = 80;
@@ -122,7 +122,7 @@ function MeshGraph() {
const zoom = d3
.zoom()
.scaleExtent([1, 8])
- .on('zoom', function (event) {
+ .on('zoom', (event) => {
svg.selectAll('.links, .nodes').attr('transform', event.transform);
});
@@ -145,18 +145,14 @@ function MeshGraph() {
.forceSimulation()
.force(
'link',
- d3.forceLink().id(function (d) {
- return d.hostname;
- })
+ d3.forceLink().id((d) => d.hostname)
)
.force('charge', d3.forceManyBody().strength(-350))
.force(
'collide',
- d3.forceCollide(function (d) {
- return d.node_type === 'execution' || d.node_type === 'hop'
- ? 75
- : 100;
- })
+ d3.forceCollide((d) =>
+ d.node_type === 'execution' || d.node_type === 'hop' ? 75 : 100
+ )
)
.force('center', d3.forceCenter(width / 2, height / 2));
@@ -172,19 +168,8 @@ function MeshGraph() {
.style('stroke', '#ccc')
.style('stroke-width', '2px')
.attr('pointer-events', 'none')
- .on('mouseover', function (event, d) {
- // tooltip
- // .html(`source: ${d.source.hostname}
target: ${d.target.hostname}`)
- // .style('visibility', 'visible');
+ .on('mouseover', function showPointer() {
d3.select(this).transition().style('cursor', 'pointer');
- })
- .on('mousemove', function () {
- // tooltip
- // .style('top', event.pageY - 10 + 'px')
- // .style('left', event.pageX + 10 + 'px');
- })
- .on('mouseout', function () {
- // tooltip.html(``).style('visibility', 'hidden');
});
const node = svg
@@ -194,53 +179,42 @@ function MeshGraph() {
.data(graph.nodes)
.enter()
.append('g')
- .on('mouseenter', function (event, d) {
+ .on('mouseenter', function handleNodeHover(_, d) {
d3.select(this).transition().style('cursor', 'pointer');
- highlightSiblings(d)
+ highlightSiblings(d);
tooltip
.html(
`