qpid-dispatch git commit: DISPATCH-753 Don't use arrow functions or bitwise comparisons since they break IE

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

qpid-dispatch git commit: DISPATCH-753 Don't use arrow functions or bitwise comparisons since they break IE

eallen
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 592553d7c -> 5ee5bc9be


DISPATCH-753 Don't use arrow functions or bitwise comparisons since they break IE


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

Branch: refs/heads/master
Commit: 5ee5bc9beae58e4ecc841479689591e12aac28ef
Parents: 592553d
Author: Ernest Allen <[hidden email]>
Authored: Sat Jun 17 14:16:00 2017 -0400
Committer: Ernest Allen <[hidden email]>
Committed: Sat Jun 17 14:16:00 2017 -0400

----------------------------------------------------------------------
 .../main/webapp/plugin/html/tmplListTree.html   |  2 +-
 .../webapp/plugin/html/tmplOverviewTree.html    |  6 ++-
 .../hawtio/src/main/webapp/plugin/js/qdrList.js |  4 ++
 .../src/main/webapp/plugin/js/qdrOverview.js    | 51 +++++++++++++++++---
 .../src/main/webapp/plugin/js/qdrTopology.js    |  2 +-
 console/stand-alone/plugin/js/qdrService.js     | 48 +++++++++++++-----
 6 files changed, 91 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
index 23833f9..d528846 100644
--- a/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
+++ b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
@@ -21,7 +21,7 @@
     <div class="pane-wrapper">
         <div class="pane-header-wrapper">
             <div class="tree-header"><select ng-options="node as node.name for node in nodes" ng-model="currentNode" ng-change="selectNode(currentNode)"></select></div>
-            <div ng-hide="largeNetwork" class="expand-collapse">
+            <div ng-hide="largeNetwork" ng-if="showExpandCollapseTree()" class="expand-collapse">
                 <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
                 <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
             </div>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
index 9222b5c..c25192c 100644
--- a/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
+++ b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
@@ -19,8 +19,10 @@
 
 <script type="text/ng-template" id="overviewheader.html">
     <div class="expand-collapse" ng-controller="QDR.OverviewController">
-        <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
-        <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
+        <div ng-if="showExpandCollapseTree()" >
+            <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
+            <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
+        </div>
     </div>
 </script>
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/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 ec2efb2..418460b 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrList.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrList.js
@@ -707,6 +707,10 @@ var QDR = (function(QDR) {
     var treeReady = false;
     var serviceReady = false;
     $scope.largeNetwork = QDRService.isLargeNetwork()
+    $scope.showExpandCollapseTree = function () {
+      QDR.log.info("showExpandCollapseTree returning " + !QDRService.isMSIE())
+      return !QDRService.isMSIE()
+    }
     // called after we know for sure the schema is fetched and the routers are all ready
     QDRService.addUpdatedAction("initList", function () {
       QDRService.stopUpdating();

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/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 d9f9367..5c1413b 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrOverview.js
@@ -952,15 +952,47 @@ var QDR = (function (QDR) {
           if (field != "title" && field != "uid")
             filteredFields.push({attribute: field, value: entity.data.fields[field]})
         })
-        $timeout(() => $scope[entityName.toLowerCase()+'Fields'] = filteredFields)
-        //$scope[entityName.toLowerCase()+'Fields'] = filteredFields
-        console.log("-------------- " + entityName + "Fields -----------")
-        console.dump(filteredFields)
+        $scope[entityName.toLowerCase()+'Fields'] = filteredFields
         scheduleNextUpdate()
         loadColState($scope[entityName.toLowerCase()+'Grid']);
+        //$timeout(() => $scope[entityName.toLowerCase()+'Fields'] = filteredFields)
       }
     }
 
+    var ConnectionInfo = function (entity) {
+        if (!entity) {
+          QDR.log.info('****************** entity was not. returning')
+          return
+        }
+        $scope.Connection = entity
+QDR.log.info("ConnectionInfo called with " + entity)
+QDR.log.info("$scope.Connection.data.title = " + $scope.Connection.data.title);
+        var currentEntity = getCurrentLinksEntity()
+        if (currentEntity === 'Connection' && entityModes[currentEntity] && entityModes[currentEntity].currentModeId === 'links') {
+          updateModeLinks()
+          scheduleNextUpdate()
+          return
+        }
+        var filteredFields = []
+        var fields = Object.keys(entity.data.fields)
+        fields.forEach( function (field) {
+          if (field != "title" && field != "uid")
+            filteredFields.push({attribute: field, value: entity.data.fields[field]})
+        })
+        $scope.ConnectionFields = filteredFields
+//QDR.log.info("$scope.connectionFields = ");
+//console.dump($scope.connectionFields)
+QDR.log.info("-------------- ConnectionFields  -----------")
+console.dump(filteredFields)
+QDR.log.info("connectionGrid.data is " + $scope.connectionGrid.data)
+//$scope.connectionGrid.data = $scope.connectionFields
+QDR.log.info("$scope.Connection = " + $scope.Connection)
+//console.dump($scope.Connection)
+        scheduleNextUpdate()
+        loadColState($scope.connectionGrid);
+        //$timeout(() => $scope[entityName.toLowerCase()+'Fields'] = filteredFields)
+    }
+
     // get info for a single connection
     $scope.gridModes = [{
         content: '<a><i class="icon-list"></i> Attriutes</a>',
@@ -1062,6 +1094,10 @@ QDR.log.debug("setting linkFields to [] in selectMode")
       return row.entity.adminStatus === 'disabled' ? "Revive" : "Quiesce";
     }
 
+    $scope.showExpandCollapseTree = function () {
+      QDR.log.info("showExpandCollapseTree returning " + !QDRService.isMSIE())
+      return !QDRService.isMSIE()
+    }
     $scope.expandAll = function () {
       $("#overtree").dynatree("getRoot").visit(function(node){
                 node.expand(true);
@@ -1476,7 +1512,7 @@ QDR.log.debug("setting linkFields to [] in selectMode")
 
     // we are currently connected. setup a handler to get notified if we are ever disconnected
     QDRService.addDisconnectAction( function () {
-      $timeout( () => QDRService.redirectWhenConnected("overview") )
+      $timeout( function () {QDRService.redirectWhenConnected("overview")} )
     })
 
     /* --------------------------------------------------
@@ -1631,7 +1667,8 @@ QDR.log.debug("newly created node needs to be activated")
     topLevelChildren.push(connections)
 
     updateConnectionTree = function (connectionFields) {
-      var info = SingleEntityInfo('Connection')
+      //var info = SingleEntityInfo('Connection')
+      var info = ConnectionInfo
       var worker = function (connection) {
         var c = new Folder(connection.host)
         var isConsole = QDRService.isAConsole (connection.properties, connection.identity, connection.role, connection.routerId)
@@ -1749,7 +1786,7 @@ QDR.log.debug("newly created node needs to be activated")
     }
     var tick = function () {
       clearTimeout(tickTimer)
-      updateExpanded();
+      $timeout( updateExpanded )
     }
     dataReady = true;
     initTreeAndGrid();

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/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 a594b3a..1449008 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
@@ -489,7 +489,7 @@ QDR.log.debug("attr.description " + attr.description)
       $scope.isFixed = function() {
         if (!$scope.contextNode)
           return false;
-        return ($scope.contextNode.fixed & 0b1);
+        return ($scope.contextNode.fixed == 1);
       }
 
       var mouseX, mouseY;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ee5bc9b/console/stand-alone/plugin/js/qdrService.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrService.js b/console/stand-alone/plugin/js/qdrService.js
index 607d8b5..93a9f76 100644
--- a/console/stand-alone/plugin/js/qdrService.js
+++ b/console/stand-alone/plugin/js/qdrService.js
@@ -179,7 +179,20 @@ console.dump(e)
 
       onSubscription: function() {
         self.executeConnectActions();
-        //self.getSchema();
+        var org = $location.search()
+        if (org)
+          org = org.org
+          //QDR.log.info('onSubscription: org is ' + org)
+        if (org && org.length > 0 && org !== "connect") {
+          //QDR.log.info('going to ' + org)
+          self.getSchema(function () {
+            self.setUpdateEntities([])
+            self.topology.get()
+            $location.path(org)
+            $location.search('org', null)
+            $location.replace()
+          });
+        }
       },
 
       startUpdating: function() {
@@ -269,6 +282,9 @@ console.dump(e)
       isLargeNetwork: function () {
         return Object.keys(self.topology._nodeInfo).length >= 12
       },
+      isMSIE: function () {
+        return (document.documentMode || /Edge/.test(navigator.userAgent))
+      },
 
       // given an attribute name array, find the value at the same index in the values array
       valFor: function(aAr, vAr, key) {
@@ -756,12 +772,12 @@ console.dump(e)
 
 
       getSchema: function(callback) {
-        //QDR.log.debug("getting schema");
+        //QDR.log.info("getting schema");
         var ret;
         self.correlator.request(
           ret = self.sendMgmtQuery('GET-SCHEMA')
         ).then(ret.id, function(response) {
-          //QDR.log.debug("Got schema response");
+          //QDR.log.info("Got schema response");
           // remove deprecated
           for (var entityName in response.entityTypes) {
             var entity = response.entityTypes[entityName]
@@ -955,6 +971,7 @@ console.dump(e)
           return
         }
         self.connectionTimer = setTimeout(function () {
+          connection.close()
           callback({error: "timedout"})
         }, timeout)
         connection.on("connection_open", function (context) {
@@ -964,6 +981,7 @@ console.dump(e)
       },
 
       connect: function(options) {
+        var connection;
         clearTimeout(self.connectionTimer)
         self.topologyInitialized = false;
         if (!self.connected) {
@@ -988,7 +1006,7 @@ console.dump(e)
           }
           var maybeStart = function() {
             if (okay.connection && okay.sender && okay.receiver && self.sendable && !self.connected) {
-              QDR.log.info("okay to start")
+              //QDR.log.info("okay to start")
               self.connected = true;
               self.connection = connection;
               self.sender = sender;
@@ -1006,7 +1024,9 @@ console.dump(e)
 
           // called after connection.open event is fired or connection error has happened
           var connectionCallback = function (options) {
+            //QDR.log.info('connectionCallback called')
             if (!options.error) {
+              //QDR.log.info('there was no error')
               connection = options.connection
               self.version = options.context.connection.properties.version
               QDR.log.debug("connection_opened")
@@ -1015,19 +1035,19 @@ console.dump(e)
               okay.sender = false;
 
               connection.on('disconnected', function(context) {
-                QDR.log.debug("connection disconnected")
+                //QDR.log.info("connection.on(disconnected) called")
                 self.errorText = "Unable to connect"
                 onDisconnect();
               })
               connection.on('connection_close', function(context) {
-                QDR.log.debug("connection closed")
+                //QDR.log.info("connection closed")
                 self.errorText = "Disconnected"
                 onDisconnect();
               })
 
               sender = connection.open_sender();
               sender.on('sender_open', function(context) {
-                QDR.log.debug("sender_opened")
+                //QDR.log.info("sender_opened")
                 okay.sender = true
                 maybeStart()
               })
@@ -1043,13 +1063,19 @@ console.dump(e)
                 }
               });
               receiver.on('receiver_open', function(context) {
-                QDR.log.debug("receiver_opened")
-                okay.receiver = true;
-                maybeStart()
+                //QDR.log.info("receiver_opened")
+                if (receiver.remote && receiver.remote.attach && receiver.remote.attach.source) {
+                  okay.receiver = true;
+                  maybeStart()
+                }
               })
               receiver.on("message", function(context) {
                 self.correlator.resolve(context);
               });
+            } else {
+              //QDR.log.info("there was an error " + options.error)
+              self.errorText = "Unable to connect"
+              onDisconnect();
             }
           }
 
@@ -1058,7 +1084,7 @@ console.dump(e)
           if (!options.connection) {
             QDR.log.debug("rhea.connect was not passed an existing connection")
             options.reconnect = true
-            self.testConnect(options, 10000, connectionCallback)
+            self.testConnect(options, 5000, connectionCallback)
           } else {
             QDR.log.debug("rhea.connect WAS passed an existing connection")
             connectionCallback(options)


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