diff --git a/awx/ui/src/screens/TopologyView/Legend.js b/awx/ui/src/screens/TopologyView/Legend.js new file mode 100644 index 0000000000..3ecc5492d5 --- /dev/null +++ b/awx/ui/src/screens/TopologyView/Legend.js @@ -0,0 +1,139 @@ +/* eslint-disable i18next/no-literal-string */ +import React from 'react'; +import styled from 'styled-components'; +import { + Button as PFButton, + DescriptionList as PFDescriptionList, + DescriptionListTerm, + DescriptionListGroup as PFDescriptionListGroup, + DescriptionListDescription as PFDescriptionListDescription, + Divider, + TextContent, + Text as PFText, + TextVariants, +} from '@patternfly/react-core'; + +import { + ExclamationIcon as PFExclamationIcon, + CheckIcon as PFCheckIcon, +} from '@patternfly/react-icons'; + +const Wrapper = styled.div` + position: absolute; + top: -20px; + left: 0; + padding: 10px; + width: 190px; +`; +const Button = styled(PFButton)` + width: 20px; + height: 20px; + border-radius: 10px; + padding: 0; + font-size: 11px; +`; +const DescriptionListDescription = styled(PFDescriptionListDescription)` + font-size: 11px; +`; +const ExclamationIcon = styled(PFExclamationIcon)` + fill: white; + margin-left: 2px; +`; +const CheckIcon = styled(PFCheckIcon)` + fill: white; + margin-left: 2px; +`; +const DescriptionList = styled(PFDescriptionList)` + gap: 7px; +`; +const DescriptionListGroup = styled(PFDescriptionListGroup)` + align-items: center; +`; +const Text = styled(PFText)` + margin: 10px 0 5px; +`; + +function Legend() { + return ( + + + + Legend + + + Node types + + + + + + + Control node + + + + + + + Execution node + + + + + + + Hybrid node + + + + + + Hop node + + + + Status types + + + + + + + + {nodeDetail.hostname} + + + + Type + + {nodeDetail.node_type} node + + + + Status + + + + + + + )} + + ); +} + +export default Tooltip; diff --git a/awx/ui/src/screens/TopologyView/TopologyView.js b/awx/ui/src/screens/TopologyView/TopologyView.js index a3ee8ffab3..0d596cc5e4 100644 --- a/awx/ui/src/screens/TopologyView/TopologyView.js +++ b/awx/ui/src/screens/TopologyView/TopologyView.js @@ -1,15 +1,14 @@ import React, { useEffect, useCallback } from 'react'; -import { useHistory } from 'react-router-dom'; - import { t } from '@lingui/macro'; import ScreenHeader from 'components/ScreenHeader/ScreenHeader'; import { PageSection, Card, CardBody } from '@patternfly/react-core'; import useRequest from 'hooks/useRequest'; -import { MeshAPI, InstancesAPI } from 'api'; +import { MeshAPI } from 'api'; import MeshGraph from './MeshGraph'; function TopologyView() { const { + isLoading, result: { meshData }, // error: fetchInitialError, request: fetchMeshVisualizer, @@ -22,15 +21,6 @@ function TopologyView() { }, []), { meshData: { nodes: [], links: [] } } ); - async function RedirectToDetailsPage({ id: nodeId }) { - const history = useHistory(); - const { - data: { results }, - } = await InstancesAPI.readInstanceGroup(nodeId); - const { id: instanceGroupId } = results[0]; - const constructedURL = `/instance_groups/${instanceGroupId}/instances/${nodeId}/details`; - history.push(constructedURL); - } useEffect(() => { fetchMeshVisualizer(); }, [fetchMeshVisualizer]); @@ -40,14 +30,7 @@ function TopologyView() { - - {meshData && ( - - )} - + {!isLoading && }