You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2016/10/24 20:35:58 UTC

qpid-dispatch git commit: DISPATCH-540 Render connections with in and out links with both yellow and green

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 4fc43944a -> bbc6f2f6d


DISPATCH-540 Render connections with in and out links with both yellow and green


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/bbc6f2f6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/bbc6f2f6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/bbc6f2f6

Branch: refs/heads/master
Commit: bbc6f2f6d76d1318c0471a75bacfccbc8ec1dae2
Parents: 4fc4394
Author: Ernest Allen <ea...@redhat.com>
Authored: Mon Oct 24 16:35:40 2016 -0400
Committer: Ernest Allen <ea...@redhat.com>
Committed: Mon Oct 24 16:35:40 2016 -0400

----------------------------------------------------------------------
 console/stand-alone/plugin/css/dispatch.css  |  3 +--
 console/stand-alone/plugin/js/qdrTopology.js | 27 +++++++++++++++--------
 2 files changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbc6f2f6/console/stand-alone/plugin/css/dispatch.css
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/css/dispatch.css b/console/stand-alone/plugin/css/dispatch.css
index b997115..060a37b 100644
--- a/console/stand-alone/plugin/css/dispatch.css
+++ b/console/stand-alone/plugin/css/dispatch.css
@@ -86,7 +86,6 @@ circle.node {
   stroke-width: 1.5px;
   cursor: pointer;
   stroke: darkgray;
-  fill: lightgray;
 }
 
 circle.node.reflexive {
@@ -104,7 +103,7 @@ circle.node.highlighted {
 circle.node.inter-router {
     fill: #EAEAEA;
 }
-circle.node.normal {
+circle.node.normal.in {
     fill: #F0F000;
 }
 circle.node.normal.out {

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbc6f2f6/console/stand-alone/plugin/js/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrTopology.js b/console/stand-alone/plugin/js/qdrTopology.js
index cb04e55..33cfb11 100644
--- a/console/stand-alone/plugin/js/qdrTopology.js
+++ b/console/stand-alone/plugin/js/qdrTopology.js
@@ -711,7 +711,6 @@ var QDR = (function(QDR) {
                 node.host = connection.host
                 node.connectionId = connection.identity
                 node.cdir = cdir
-
                 // determine arrow direction by using the link directions
                 if (!normalsParent[nodeType+cdir]) {
                   normalsParent[nodeType+cdir] = node;
@@ -744,12 +743,12 @@ var QDR = (function(QDR) {
           .linkDistance(function(d) {
             if (d.target.nodeType === 'inter-router')
               return 80
-            if (d.target.properties.console_identifier)
+            if (d.target.cdir === 'both')
               return 70
             return 55
           })
           .charge(function(d) {
-            return (d.nodeType === 'inter-router') ? -3000 : (d.properties.console_identifier ? -300 : -30)
+            return (d.nodeType === 'inter-router') ? -3000 : (d.cdir === 'both' ? -300 : -30)
           })
           .friction(.10)
           .gravity(0.0001)
@@ -780,6 +779,15 @@ var QDR = (function(QDR) {
           .append("svg:path")
             .attr('d', 'M 10 -5 L 0 0 L 10 5 z');
 
+        var grad = svg.append("svg:defs").append("linearGradient")
+          .attr("id", "half-circle")
+          .attr("x1", "0%")
+          .attr("x2", "0%")
+          .attr("y1", "100%")
+          .attr("y2", "0%");
+        grad.append("stop").attr("offset", "50%").style("stop-color", "#C0F0C0");
+        grad.append("stop").attr("offset", "50%").style("stop-color", "#F0F000");
+
         // handles to link and node element groups
         path = svg.append('svg:g').selectAll('path'),
           circle = svg.append('svg:g').selectAll('g');
@@ -1365,6 +1373,12 @@ var QDR = (function(QDR) {
             .attr('r', function(d) {
               return radii[d.nodeType]
             })
+            .attr('fill', function (d) {
+              if (d.cdir === 'both' && !QDRService.isConsole(d)) {
+                return 'url(' + urlPrefix + '#half-circle)'
+              }
+              return null;
+            })
             .classed('fixed', function(d) {
               return d.fixed
             })
@@ -1928,26 +1942,21 @@ var QDR = (function(QDR) {
       });
 
       function handleInitialUpdate() {
-//QDR.log.debug("initital update done")
         QDRService.delUpdatedAction("topologyInitialized")
+        // now we only need to update connections during steady-state
         QDRService.setUpdateEntities([".connection"])
         // we currently have all entities available on all routers
         saveChanged();
         animate = true;
         initForceGraph();
         QDRService.initEntity(".router.node", function () {})
-        // now we only need to update connections during steady-state
-//QDR.log.debug("now only need to get connection")
         QDRService.addUpdatedAction("topology", function() {
-//QDR.log.debug("topology minimal update done. checking for changed")
           var changed = hasChanged()
           // there is a new node, we need to get all of it's entities before drawing the svg
           if (changed > 0) {
-            //QDR.log.debug("oops, a new router was added! regetting all entities")
             QDRService.delUpdatedAction("topology")
             setupInitialUpdate()
           } else if (changed === -1) {
-            //QDR.log.debug("a router was dropped! no need to reget entities")
             // we lost a node, we can draw the new svg immediately
             saveChanged();
             animate = true;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org