Repository: qpid-dispatch
Updated Branches:
  refs/heads/master e96c7ed50 -> 13c2107ba


DISPATCH-1003 Adding username/password fields to hawtio 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/13c2107b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/13c2107b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/13c2107b

Branch: refs/heads/master
Commit: 13c2107ba96bd901e90a47a494c3a73732471602
Parents: e96c7ed
Author: Ernest Allen <eal...@redhat.com>
Authored: Tue Jun 12 06:36:52 2018 -0400
Committer: Ernest Allen <eal...@redhat.com>
Committed: Tue Jun 12 06:36:52 2018 -0400

----------------------------------------------------------------------
 .../src/main/webapp/plugin/html/qdrConnect.html | 29 ++++++++++++++++++--
 .../src/main/webapp/plugin/js/qdrService.js     | 16 +++++++----
 2 files changed, 37 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/13c2107b/console/hawtio/src/main/webapp/plugin/html/qdrConnect.html
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/html/qdrConnect.html 
b/console/hawtio/src/main/webapp/plugin/html/qdrConnect.html
index 8a73177..412eab9 100644
--- a/console/hawtio/src/main/webapp/plugin/html/qdrConnect.html
+++ b/console/hawtio/src/main/webapp/plugin/html/qdrConnect.html
@@ -46,16 +46,39 @@ under the License.
                               </div>
                           </div>
                           <div class="control-group">
+                              <label tabindex="-1" class="control-label" 
title="Username">Username: </label>
+                              <div class="controls">
+                                  <input tabindex="3" type="text" 
placeholder="username" 
+                                    tooltip="Username to use for 
authentication" 
+                                    ng-model="formEntity.username" 
+                                    name="username" 
+                                    title="Username">
+                              </div>
+                          </div>
+                          <div class="control-group">
+                              <label tabindex="-1" class="control-label" 
title="Password">Password: </label>
+                              <div class="controls">
+                                  <input tabindex="4" type="password" 
placeholder="password" 
+                                    tooltip="Password to use for 
authentication" 
+                                    ng-model="formEntity.password" 
+                                    name="password" 
+                                    title="Password">
+                              </div>
+                          </div>
+                          <div class="control-group">
                               <label tabindex="-1" class="control-label" 
title="Whether or not the connection should be started as soon as you log into 
hawtio">Autostart: </label>
                               <div class="controls">
-                                  <input tabindex="3" type="checkbox" 
tooltip="Whether or not the connection should be started as soon as you log 
into hawtio" ng-model="formEntity.autostart" name="autostart" title="Whether or 
not the connection should be started as soon as you log into hawtio"
-                                         class="ng-scope ng-pristine 
ng-valid"></div>
+                                  <input tabindex="5" type="checkbox" 
+                                    tooltip="Whether or not the connection 
should be started as soon as you log into hawtio" 
+                                    ng-model="formEntity.autostart" 
+                                    name="autostart" 
+                                    title="Whether or not the connection 
should be started as soon as you log into hawtio"
+                              ></div>
                           </div>
                           <input tabindex="-1" type="submit" style="position: 
absolute; left: -9999px; width: 1px; height: 1px;">
                           <p></p>
                           <div>
                               <button type="submit" tabindex="4" class="btn 
btn-primary pull-right" 
ng-disabled="settings.$invalid">{{buttonText()}}</button>
-                              <!-- <button tabindex="-1" class="btn 
btn-secondary pull-right" ng-click="connect1()">Debug</button> -->
                           </div>
                       </fieldset>
                   </form>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/13c2107b/console/hawtio/src/main/webapp/plugin/js/qdrService.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrService.js 
b/console/hawtio/src/main/webapp/plugin/js/qdrService.js
index 73102a7..6b4a531 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrService.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrService.js
@@ -967,14 +967,20 @@ console.dump(e)
         QDR.log.info("testConnect called with reconnect " + reconnect + " 
using " + protocol + " protocol")
         try {
           var ws = self.rhea.websocket_connect(WebSocket);
-          connection = self.rhea.connect({
+          var c = {
             connection_details: ws(protocol + "://" + baseAddress, ["binary"]),
             reconnect: reconnect,
-              properties: {
-                console_identifier: 'Dispatch console'
-              }
+            properties: {
+              console_identifier: 'Dispatch console'
             }
-          );
+          };
+          if (options.username && options.username !== '') {
+            c.username = options.username;
+          }
+          if (options.password && options.password !== '') {
+            c.password = options.password;
+          }
+          connection = self.rhea.connect(c);
         } catch (e) {
           QDR.log.debug("exception caught on test connect " + e)
           self.errorText = "Connection failed "


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

Reply via email to