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 2018/06/12 19:05:44 UTC

qpid-dispatch git commit: DISPATCH-1003 Fixing disconnect between form and options sent to connect.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 2f3d32d5b -> 8c7e87275


DISPATCH-1003 Fixing disconnect between form and options sent to connect.


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

Branch: refs/heads/master
Commit: 8c7e87275fb481f25d8deaa4f639f3a4d1c532d9
Parents: 2f3d32d
Author: Ernest Allen <ea...@redhat.com>
Authored: Tue Jun 12 15:05:29 2018 -0400
Committer: Ernest Allen <ea...@redhat.com>
Committed: Tue Jun 12 15:05:29 2018 -0400

----------------------------------------------------------------------
 console/hawtio/pom.xml                          | 35 ++------
 .../src/main/webapp/plugin/js/qdrSettings.js    | 85 +++++++++++---------
 console/stand-alone/plugin/js/qdrSettings.js    |  6 +-
 3 files changed, 55 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8c7e8727/console/hawtio/pom.xml
----------------------------------------------------------------------
diff --git a/console/hawtio/pom.xml b/console/hawtio/pom.xml
index 6bf687f..b67e083 100644
--- a/console/hawtio/pom.xml
+++ b/console/hawtio/pom.xml
@@ -44,6 +44,10 @@
     <url>https://git-wip-us.apache.org/repos/asf?p=qpid-dispatch.git</url>
   </scm>
 
+  <prerequisites>
+    <maven>3.0.4</maven>
+  </prerequisites>
+
   <properties>
     <!-- filtered plugin properties, we don't define plugin-scripts here
       as we build that dynamically using maven-antrun-plugin below. -->
@@ -203,14 +207,7 @@
 
       <!-- maven-bundle-plugin config, needed to make this war
         deployable in karaf, defines the context that this bundle
-        should handle requests on 
-
-        commented out because of:
-        [WARNING] Manifest org.apache.qpid:dispatch-hawtio-console:war:1.2.0-SNAPSHOT : None of Export-Package, Provide-Package, Private-Package, -testpackages, or -exportcontents is set, therefore no packages will be included
-        [WARNING] Manifest org.apache.qpid:dispatch-hawtio-console:war:1.2.0-SNAPSHOT : No sub JAR or directory WEB-INF/classes
-      -->
-
-      <!--
+        should handle requests on -->
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
@@ -252,28 +249,6 @@
             <Implementation-Version>${project.version}</Implementation-Version>
           </instructions>
         </configuration>
-      </plugin>-->
-
-      <!-- maven-enforcer-plugin is now used instead of prerequisites for non maven-plugin projects -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <version>3.0.0-M1</version>
-        <executions>
-          <execution>
-            <id>enforce-maven</id>
-            <goals>
-              <goal>enforce</goal>
-            </goals>
-            <configuration>
-              <rules>
-                <requireMavenVersion>
-                  <version>3.0.4</version>
-                </requireMavenVersion>
-              </rules>    
-            </configuration>
-          </execution>
-        </executions>
       </plugin>
 
       <!-- We define the maven-war-plugin here and make sure it uses

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8c7e8727/console/hawtio/src/main/webapp/plugin/js/qdrSettings.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrSettings.js b/console/hawtio/src/main/webapp/plugin/js/qdrSettings.js
index 31bfef5..9bfc069 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrSettings.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrSettings.js
@@ -16,6 +16,7 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 */
+/* global angular */
 /**
  * @module QDR
  */
@@ -29,7 +30,7 @@ var QDR = (function(QDR) {
    * Controller that handles the QDR settings page
    */
 
-  QDR.module.controller("QDR.SettingsController", ['$scope', 'QDRService', '$timeout', '$location', function($scope, QDRService, $timeout, $location) {
+  QDR.module.controller('QDR.SettingsController', ['$scope', 'QDRService', '$timeout', '$location', function($scope, QDRService, $timeout, $location) {
 
     $scope.connecting = false;
     $scope.connectionError = false;
@@ -43,18 +44,22 @@ var QDR = (function(QDR) {
       password: '',
       autostart: false
     };
+    $scope.formEntity.password = '';
 
     $scope.$watch('formEntity', function(newValue, oldValue) {
       if (newValue !== oldValue) {
+        let pass = newValue.password;
+        newValue.password = '';
         localStorage[QDR.SETTINGS_KEY] = angular.toJson(newValue);
+        newValue.password = pass;
       }
     }, true);
 
     $scope.buttonText = function() {
       if (QDRService.isConnected()) {
-        return "Disconnect";
+        return 'Disconnect';
       } else {
-        return "Connect";
+        return 'Connect';
       }
     };
 
@@ -62,7 +67,7 @@ var QDR = (function(QDR) {
       if (QDRService.connected) {
         $timeout( function () {
           QDRService.disconnect();
-        })
+        });
         return;
       }
 
@@ -71,50 +76,50 @@ var QDR = (function(QDR) {
         $scope.connecting = true;
         // timeout so connecting animation can display
         $timeout(function () {
-          doConnect()
-        })
+          doConnect();
+        });
       }
-    }
+    };
 
     var doConnect = function(opts) {
       if (!$scope.formEntity.address)
-        $scope.formEntity.address = "localhost"
+        $scope.formEntity.address = 'localhost';
       if (!$scope.formEntity.port)
-        $scope.formEntity.port = 5673
+        $scope.formEntity.port = 5673;
 
       var failed = function() {
         $timeout(function() {
-          QDR.log.debug("disconnect action called");
+          QDR.log.debug('disconnect action called');
           $scope.connecting = false;
           $scope.connectionErrorText = QDRService.errorText;
           $scope.connectionError = true;
-        })
-      }
+        });
+      };
       QDRService.addDisconnectAction(failed);
       QDRService.addConnectAction(function() {
-        QDRService.delDisconnectAction(failed)
+        QDRService.delDisconnectAction(failed);
         QDRService.getSchema(function () {
-          QDR.log.info("got schema after connection")
-          QDRService.addUpdatedAction("initialized", function () {
-            QDRService.delUpdatedAction("initialized")
-            QDR.log.info("got initial topology")
+          QDR.log.info('got schema after connection');
+          QDRService.addUpdatedAction('initialized', function () {
+            QDRService.delUpdatedAction('initialized');
+            QDR.log.info('got initial topology');
             $timeout(function() {
               $scope.connecting = false;
               if ($location.path().startsWith(QDR.pluginRoot)) {
-                  var searchObject = $location.search();
-                  var goto = "overview";
-                  if (searchObject.org && searchObject.org !== "connect") {
-                    goto = searchObject.org;
-                  }
-                  $location.search('org', null)
-                  $location.path(QDR.pluginRoot + "/" + goto);
+                var searchObject = $location.search();
+                var goto = 'overview';
+                if (searchObject.org && searchObject.org !== 'connect') {
+                  goto = searchObject.org;
+                }
+                $location.search('org', null);
+                $location.path(QDR.pluginRoot + '/' + goto);
               }
-            })
-          })
-          QDR.log.info("requesting a topology")
-          QDRService.setUpdateEntities([])
-          QDRService.topology.get()
-        })
+            });
+          });
+          QDR.log.info('requesting a topology');
+          QDRService.setUpdateEntities([]);
+          QDRService.topology.get();
+        });
       });
       var options = {address: $scope.formEntity.address, 
         port: $scope.formEntity.port, 
@@ -122,11 +127,11 @@ var QDR = (function(QDR) {
         password: $scope.formEntity.password};
       // if we have already successfully connected (the test connections succeeded)
       if (opts && opts.connection) {
-        options.connection = opts.connection
-        options.context = opts.context
+        options.connection = opts.connection;
+        options.context = opts.context;
       }
       QDRService.connect(options);
-    }
+    };
   }]);
 
 
@@ -139,13 +144,13 @@ var QDR = (function(QDR) {
         elem.bind('keypress', function(event) {
           var nkey = !event.charCode ? event.which : event.charCode;
           var skey = String.fromCharCode(nkey);
-          var nono = "-+.,"
+          var nono = '-+.,';
           if (nono.indexOf(skey) >= 0) {
             event.preventDefault();
             return false;
           }
           // firefox doesn't filter out non-numeric input. it just sets the ctrl to invalid
-          if (/[\!\@\#\$\%^&*\(\)]/.test(skey) && event.shiftKey || // prevent shift numbers
+          if (/[!@#$%^&*()]/.test(skey) && event.shiftKey || // prevent shift numbers
             !( // prevent all but the following
               nkey <= 0 || // arrows
               nkey == 8 || // delete|backspace
@@ -157,10 +162,10 @@ var QDR = (function(QDR) {
             event.preventDefault();
             return false;
           }
-        })
-          // check the current value of input
+        });
+        // check the current value of input
         var _isPortInvalid = function(value) {
-          var port = value + ''
+          var port = value + '';
           var isErrRange = false;
           // empty string is valid
           if (port.length !== 0) {
@@ -169,9 +174,9 @@ var QDR = (function(QDR) {
               isErrRange = true;
             }
           }
-          ctrl.$setValidity('range', !isErrRange)
+          ctrl.$setValidity('range', !isErrRange);
           return isErrRange;
-        }
+        };
 
         //For DOM -> model validation
         ctrl.$parsers.unshift(function(value) {

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8c7e8727/console/stand-alone/plugin/js/qdrSettings.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrSettings.js b/console/stand-alone/plugin/js/qdrSettings.js
index d53123f..e73d13b 100644
--- a/console/stand-alone/plugin/js/qdrSettings.js
+++ b/console/stand-alone/plugin/js/qdrSettings.js
@@ -97,7 +97,11 @@ var QDR = (function(QDR) {
           $scope.connectionError = true;
         });
       };
-      let options = {address: $scope.formEntity.address, port: $scope.formEntity.port, reconnect: true};
+      let options = {address: $scope.formEntity.address, 
+        port: $scope.formEntity.port, 
+        password: $scope.formEntity.password,
+        username: $scope.formEntity.username,
+        reconnect: true};
       QDRService.connect(options)
         .then( function () {
           // register a callback for when the node list is available (needed for loading saved charts)


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