From 6834568c5d65fb656f0cb8b3ac8f6c4c9624b026 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 10 May 2023 12:56:36 -0400 Subject: [PATCH] Add receptor host identifier to group_vars Add disconnected link state topology --- .../group_vars/all.yml | 1 + ...uto_20230501_2000.py => 0185_hop_nodes.py} | 9 +++---- awx/ui/public/installing.html | 6 ++++- .../InstanceList/InstanceListItem.js | 2 +- .../Instances/Shared/RemoveInstanceButton.js | 2 +- awx/ui/src/screens/TopologyView/Legend.js | 15 ++++++++++++ awx/ui/src/screens/TopologyView/MeshGraph.js | 24 ++++++++++++++----- 7 files changed, 44 insertions(+), 15 deletions(-) rename awx/main/migrations/{0183_auto_20230501_2000.py => 0185_hop_nodes.py} (75%) diff --git a/awx/api/templates/instance_install_bundle/group_vars/all.yml b/awx/api/templates/instance_install_bundle/group_vars/all.yml index 952de3d6d1..e748a9bbf0 100644 --- a/awx/api/templates/instance_install_bundle/group_vars/all.yml +++ b/awx/api/templates/instance_install_bundle/group_vars/all.yml @@ -1,3 +1,4 @@ +receptor_host_identifier: {{ instance.hostname }} receptor_user: awx receptor_group: awx receptor_verify: true diff --git a/awx/main/migrations/0183_auto_20230501_2000.py b/awx/main/migrations/0185_hop_nodes.py similarity index 75% rename from awx/main/migrations/0183_auto_20230501_2000.py rename to awx/main/migrations/0185_hop_nodes.py index eb0a731fbb..153dd6a41a 100644 --- a/awx/main/migrations/0183_auto_20230501_2000.py +++ b/awx/main/migrations/0185_hop_nodes.py @@ -1,12 +1,11 @@ -# Generated by Django 3.2.16 on 2023-05-01 20:00 +# Generated by Django 4.2 on 2023-05-17 18:31 from django.db import migrations, models -import django.db.models.expressions class Migration(migrations.Migration): dependencies = [ - ('main', '0182_constructed_inventory'), + ('main', '0184_django_indexes'), ] operations = [ @@ -31,8 +30,6 @@ class Migration(migrations.Migration): ), migrations.AddConstraint( model_name='instancelink', - constraint=models.CheckConstraint( - check=models.Q(('source', django.db.models.expressions.F('target')), _negated=True), name='source_and_target_can_not_be_equal' - ), + constraint=models.CheckConstraint(check=models.Q(('source', models.F('target')), _negated=True), name='source_and_target_can_not_be_equal'), ), ] diff --git a/awx/ui/public/installing.html b/awx/ui/public/installing.html index c13091e9d6..accfbcce68 100644 --- a/awx/ui/public/installing.html +++ b/awx/ui/public/installing.html @@ -5,7 +5,11 @@ {{ title }} diff --git a/awx/ui/src/screens/Instances/InstanceList/InstanceListItem.js b/awx/ui/src/screens/Instances/InstanceList/InstanceListItem.js index 2e7caf36f6..ca0f0ed4a5 100644 --- a/awx/ui/src/screens/Instances/InstanceList/InstanceListItem.js +++ b/awx/ui/src/screens/Instances/InstanceList/InstanceListItem.js @@ -138,7 +138,7 @@ function InstanceListItem({ rowIndex, isSelected, onSelect, - disable: !isExecutionNode, + disable: !(isExecutionNode || isHopNode), }} dataLabel={t`Selected`} /> diff --git a/awx/ui/src/screens/Instances/Shared/RemoveInstanceButton.js b/awx/ui/src/screens/Instances/Shared/RemoveInstanceButton.js index b6b1fb2986..9a9e382dbf 100644 --- a/awx/ui/src/screens/Instances/Shared/RemoveInstanceButton.js +++ b/awx/ui/src/screens/Instances/Shared/RemoveInstanceButton.js @@ -33,7 +33,7 @@ function RemoveInstanceButton({ itemsToRemove, onRemove, isK8s }) { const [removeDetails, setRemoveDetails] = useState(null); const [isLoading, setIsLoading] = useState(false); - const cannotRemove = (item) => item.node_type !== 'execution'; + const cannotRemove = (item) => !(item.node_type === 'execution' || item.node_type === 'hop'); const toggleModal = async (isOpen) => { setRemoveDetails(null); diff --git a/awx/ui/src/screens/TopologyView/Legend.js b/awx/ui/src/screens/TopologyView/Legend.js index 23507c2b13..7c12dc1595 100644 --- a/awx/ui/src/screens/TopologyView/Legend.js +++ b/awx/ui/src/screens/TopologyView/Legend.js @@ -252,6 +252,21 @@ function Legend() { {t`Established`} + + + + + + + {t`Disconnected`} + diff --git a/awx/ui/src/screens/TopologyView/MeshGraph.js b/awx/ui/src/screens/TopologyView/MeshGraph.js index ca6da29664..e829cb97ff 100644 --- a/awx/ui/src/screens/TopologyView/MeshGraph.js +++ b/awx/ui/src/screens/TopologyView/MeshGraph.js @@ -208,9 +208,15 @@ function MeshGraph({ .attr('class', (_, i) => `link-${i}`) .attr('data-cy', (d) => `${d.source.hostname}-${d.target.hostname}`) .style('fill', 'none') - .style('stroke', (d) => - d.link_state === 'removing' ? '#C9190B' : '#CCC' - ) + .style('stroke', (d) => { + if (d.link_state === 'removing') { + return '#C9190B'; + } + if (d.link_state === 'disconnected') { + return '#c9700b'; + } + return '#CCC'; + }) .style('stroke-width', '2px') .style('stroke-dasharray', (d) => renderLinkState(d.link_state)) .attr('pointer-events', 'none') @@ -348,9 +354,15 @@ function MeshGraph({ .selectAll(`.link-${s.index}`) .transition() .duration(50) - .style('stroke', (d) => - d.link_state === 'removing' ? '#C9190B' : '#CCC' - ) + .style('stroke', (d) => { + if (d.link_state === 'removing') { + return '#C9190B'; + } + if (d.link_state === 'disconnected') { + return '#c9700b'; + } + return '#CCC'; + }) .style('stroke-width', '2px') .attr('marker-end', 'url(#end)'); });