Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 08d69ce0e -> b175a1d27


DISPATCH-275: Initialize grid variables before redirecting to connect page


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

Branch: refs/heads/master
Commit: b175a1d2725290343054f15f47c979b11bc983f4
Parents: 08d69ce
Author: Ernest Allen <[email protected]>
Authored: Mon Apr 18 12:54:23 2016 -0400
Committer: Ernest Allen <[email protected]>
Committed: Mon Apr 18 12:54:23 2016 -0400

----------------------------------------------------------------------
 .../hawtio/src/main/webapp/plugin/js/qdrList.js |  2 +-
 .../src/main/webapp/plugin/js/qdrOverview.js    | 33 ++---------
 .../src/main/webapp/plugin/js/qdrTopology.js    | 59 +++++++++-----------
 3 files changed, 34 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b175a1d2/console/hawtio/src/main/webapp/plugin/js/qdrList.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrList.js 
b/console/hawtio/src/main/webapp/plugin/js/qdrList.js
index 601acf5..5e22b3c 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrList.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrList.js
@@ -31,7 +31,7 @@ var QDR = (function(QDR) {
        QDR.module.controller("QDR.ListController", ['$scope', '$location', 
'$dialog', '$filter', 'localStorage', 'QDRService', 'QDRChartService',
                function ($scope, $location, $dialog, $filter, localStorage, 
QDRService, QDRChartService) {
 
-               $scope.details = [];
+               $scope.details = {};
                if (!QDRService.connected) {
                        // we are not connected. we probably got here from a 
bookmark or manual page reload
                        $location.path("/dispatch_plugin/connect")

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b175a1d2/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js 
b/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
index bf75ffd..f25df04 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
@@ -39,11 +39,6 @@ var QDR = (function (QDR) {
 
                console.log("QDR.OverviewControll started with location of " + 
$location.path() + " and connection of  " + QDRService.connected);
 
-               if (!QDRService.connected) {
-                       // we are not connected. we probably got here from a 
bookmark or manual page reload
-                       $location.path("/dispatch_plugin/connect")
-                       return;
-               }
                // we want attributes to be listed first, so add it at index 0
                $scope.subLevelTabs = [{
                    content: '<i class="icon-list"></i> Attributes',
@@ -444,28 +439,6 @@ var QDR = (function (QDR) {
                     }
                 }
             };
-/*
-                       $scope.allConnectionGrid = {
-                               data: 'allConnectionFields',
-                               columnDefs: allConnectionCols,
-                               enableHorizontalScrollbar: 
uiGridConstants.scrollbars.NEVER,
-                   enableVerticalScrollbar: uiGridConstants.scrollbars.NEVER,
-                               enableColumnResize: true,
-                               multiSelect: false,
-                               enableRowHeaderSelection: false,
-                               noUnselect: true,
-                               enableSelectAll: false,
-                               enableRowSelection: true,
-                               onRegisterApi: function (gridApi) {
-                                       
gridApi.selection.on.rowSelectionChanged($scope, function(row) {
-                                               if (row.isSelected) {
-                                                       var host = 
row.entity.host;
-                                                       
$("#overtree").fancytree("getTree").activateKey(host);
-                                               }
-                                       });
-                           }
-                       }
-*/
                        connections.children.forEach( function (connection) {
                                
$scope.allConnectionFields.push(connection.fields)
                        })
@@ -567,6 +540,12 @@ var QDR = (function (QDR) {
                }
         $scope.template = $scope.templates[0];
 
+               if (!QDRService.connected) {
+                       // we are not connected. we probably got here from a 
bookmark or manual page reload
+                       $location.path("/dispatch_plugin/connect")
+                       return;
+               }
+
        /* --------------------------------------------------
         *
      * setup the tree on the left

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b175a1d2/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js 
b/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
index a59c8d3..dbdc8e3 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
@@ -66,6 +66,30 @@ var QDR = (function (QDR) {
    */
     QDR.module.controller("QDR.TopologyController", ['$scope', '$rootScope', 
'QDRService', '$location', '$timeout', '$dialog',
     function($scope, $rootScope, QDRService, $location, $timeout, $dialog) {
+
+               $scope.multiData = [{name: ''}, {name: ''}, {name: ''}]
+        $scope.multiDetails = {
+            data: 'multiData',
+            columnDefs: [
+            {
+                field: 'host',
+                displayName: 'Host'
+            },
+            {
+                field: 'user',
+                displayName: 'User'
+            },
+                       {
+                               field: 'properties',
+                               displayName: 'Properties'
+                       },
+                       {
+                               field: 'isEncrypted',
+                               displayName: 'Encrypted'
+                       }
+            ]
+        };
+
                if (!QDRService.connected) {
                        // we are not connected. we probably got here from a 
bookmark or manual page reload
                        $location.path("/dispatch_plugin/connect")
@@ -180,29 +204,6 @@ var QDR = (function (QDR) {
                }
 
                // for ng-grid that shows details for multiple consoles/clients
-               $scope.multiData = [{name: ''}, {name: ''}, {name: ''}]
-        $scope.multiDetails = {
-            data: 'multiData',
-            columnDefs: [
-            {
-                field: 'host',
-                displayName: 'Host'
-            },
-            {
-                field: 'user',
-                displayName: 'User'
-            },
-                       {
-                               field: 'properties',
-                               displayName: 'Properties'
-                       },
-                       {
-                               field: 'isEncrypted',
-                               displayName: 'Encrypted'
-                       }
-            ]
-        };
-
                // generate unique name for router and containerName
                var genNewName = function () {
                        var nodeInfo = QDRService.topology.nodeInfo();
@@ -773,7 +774,6 @@ var QDR = (function (QDR) {
            // been added
            function restart(start) {
                circle.call(force.drag);
-               //svg.classed('ctrl', true);
 
                // path (link) group
                path = path.data(links);
@@ -835,11 +835,8 @@ var QDR = (function (QDR) {
                         updateForm(left.key, 'connection', resultIndex);
                     }
 
-                                       // select link
                                        mousedown_link = d;
                                        selected_link = mousedown_link;
-                                       //selected_node = null;
-                                       //mousedown_node = null;
                                        restart();
                                })
                    .on('mouseout', function (d) {
@@ -849,11 +846,8 @@ var QDR = (function (QDR) {
                                    }
                                    return;
                                  }
-                                       //QDR.log.debug("showing connections 
form");
-                                       // select link
+                               //QDR.log.debug("showing connections form");
                                        selected_link = null;
-                                       //selected_node = null;
-                                       //mousedown_node = null;
                                        restart();
                                })
                    .on("contextmenu", function(d) {
@@ -871,7 +865,6 @@ var QDR = (function (QDR) {
                 .on("click", function (d) {
                     dblckickPos = d3.mouse(this);
                     d3.event.stopPropagation();
-
                     var diameter = 400;
                     var format = d3.format(",d");
                     var pack = d3.layout.pack()
@@ -911,6 +904,8 @@ var QDR = (function (QDR) {
                                        containerIndex = 
links.attributeNames.indexOf('remoteContainer');
                                        var nameIndex = 
links.attributeNames.indexOf('name');
                                        var linkDirIndex = 
links.attributeNames.indexOf('linkDir');
+                                       if (containerIndex < 0 || nameIndex < 0 
|| linkDirIndex < 0)
+                                               return;
                                        links.results.forEach ( function (link) 
{
                                                if (link[containerIndex] == 
d.target.containerName)
                                                        root.children.push (


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to