You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2023/09/16 12:42:49 UTC

[camel-karavan] 02/02: Edge Styles for #893

This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git

commit e35cacfd29be55575f2e148305629be24d5f4db4
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Fri Sep 15 21:53:47 2023 -0400

    Edge Styles for #893
---
 .../src/main/webui/src/project/topology/TopologyApi.tsx    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/karavan-web/karavan-app/src/main/webui/src/project/topology/TopologyApi.tsx b/karavan-web/karavan-app/src/main/webui/src/project/topology/TopologyApi.tsx
index be9c4b57..00402d33 100644
--- a/karavan-web/karavan-app/src/main/webui/src/project/topology/TopologyApi.tsx
+++ b/karavan-web/karavan-app/src/main/webui/src/project/topology/TopologyApi.tsx
@@ -2,7 +2,9 @@ import {
     ComponentFactory,
     DefaultEdge,
     DefaultGroup,
+    EdgeAnimationSpeed,
     EdgeModel,
+    EdgeStyle,
     GraphComponent,
     Model,
     ModelKind,
@@ -98,7 +100,9 @@ export function getIncomingEdges(tins: TopologyIncomingNode[]): EdgeModel[] {
             id: 'edge-incoming-' + tin.routeId,
             type: 'edge',
             source: tin.id,
-            target: 'route-' + tin.routeId
+            target: 'route-' + tin.routeId,
+            edgeStyle: tin.type === 'external' ? EdgeStyle.dashedMd : EdgeStyle.solid,
+            animationSpeed: tin.type === 'external' ? EdgeAnimationSpeed.medium : EdgeAnimationSpeed.none
         }
         return node;
     });
@@ -110,7 +114,9 @@ export function getOutgoingEdges(tons: TopologyOutgoingNode[]): EdgeModel[] {
             id: 'edge-outgoing-' + tin.routeId + '-' + (tin.step as any).id,
             type: 'edge',
             source: 'route-' + tin.routeId,
-            target: tin.id
+            target: tin.id,
+            edgeStyle: tin.type === 'external' ? EdgeStyle.dashedMd : EdgeStyle.solid,
+            animationSpeed: tin.type === 'external' ? EdgeAnimationSpeed.medium : EdgeAnimationSpeed.none
         }
         return node;
     });
@@ -154,7 +160,9 @@ export function getRestEdges(rest: TopologyRestNode[], incomings: TopologyIncomi
                 id: 'incoming-' + tin.id + '-' + index,
                 type: 'edge',
                 source: tin.id,
-                target: target
+                target: target,
+                edgeStyle: EdgeStyle.dotted,
+                animationSpeed: EdgeAnimationSpeed.medium
             }
             if (target) result.push(node);
         })