Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D4B19200BCE for ; Fri, 2 Dec 2016 18:24:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D36C5160B24; Fri, 2 Dec 2016 17:24:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 01146160B08 for ; Fri, 2 Dec 2016 18:24:24 +0100 (CET) Received: (qmail 61833 invoked by uid 500); 2 Dec 2016 17:24:24 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 61824 invoked by uid 99); 2 Dec 2016 17:24:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 17:24:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 09FDBE04BB; Fri, 2 Dec 2016 17:24:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: eallen@apache.org To: commits@qpid.apache.org Message-Id: <3e3a21e3a3514c3b98c954c790339066@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-dispatch git commit: DISPATCH-588 Move the auto-login code to the connect page Date: Fri, 2 Dec 2016 17:24:24 +0000 (UTC) archived-at: Fri, 02 Dec 2016 17:24:26 -0000 Repository: qpid-dispatch Updated Branches: refs/heads/master 2cb5b7011 -> 785c5e023 DISPATCH-588 Move the auto-login code to the 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/785c5e02 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/785c5e02 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/785c5e02 Branch: refs/heads/master Commit: 785c5e023084753470513d864ad42a7cae650958 Parents: 2cb5b70 Author: Ernest Allen Authored: Fri Dec 2 12:24:10 2016 -0500 Committer: Ernest Allen Committed: Fri Dec 2 12:24:10 2016 -0500 ---------------------------------------------------------------------- .../src/main/webapp/plugin/js/dispatchPlugin.js | 36 +++------------- console/stand-alone/plugin/js/dispatchPlugin.js | 44 ++------------------ console/stand-alone/plugin/js/qdrSettings.js | 7 ++++ 3 files changed, 17 insertions(+), 70 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/785c5e02/console/hawtio/src/main/webapp/plugin/js/dispatchPlugin.js ---------------------------------------------------------------------- diff --git a/console/hawtio/src/main/webapp/plugin/js/dispatchPlugin.js b/console/hawtio/src/main/webapp/plugin/js/dispatchPlugin.js index 82a1de4..124eec0 100644 --- a/console/hawtio/src/main/webapp/plugin/js/dispatchPlugin.js +++ b/console/hawtio/src/main/webapp/plugin/js/dispatchPlugin.js @@ -214,44 +214,20 @@ var QDR = (function(QDR) { // our view viewRegistry[QDR.pluginName] = QDR.templatePath + "qdrLayout.html"; - var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]); - QDRService.addConnectAction(function() { + QDRService.addUpdatedAction("initChartService", function() { + QDRService.delUpdatedAction("initChartService") QDRChartService.init(); // initialize charting service after we are connected }); - if (settings && settings.autostart) { - QDRService.addDisconnectAction( function () { - $location.path(QDR.pluginRoot + "/connect"); - $location.replace(); - $rootScope.$apply(); - }) - QDRService.addConnectAction(function() { - var searchObject = $location.search(); - // the redirect will be handled by QDRService when connected - if (searchObject.org) { - return; - } - if ($location.path().startsWith(QDR.pluginRoot)) { - var lastLocation = localStorage[QDR.LAST_LOCATION]; - if (!angular.isDefined(lastLocation)) - lastLocation = QDR.pluginRoot + "/overview"; - $location.path(lastLocation); - $location.replace(); - $rootScope.$apply(); - } - }); - QDRService.connect(settings); - } - - $rootScope.$on('$routeChangeSuccess', function() { - var path = $location.path(); + $rootScope.$on('$routeChangeSuccess', function() { + var path = $location.path(); if (path.startsWith(QDR.pluginRoot)) { if (path !== QDR.pluginRoot && path !== (QDR.pluginRoot + "/") && path !== (QDR.pluginRoot + "/connect")) { - localStorage[QDR.LAST_LOCATION] = path; + localStorage[QDR.LAST_LOCATION] = path; QDR.log.info("saving page changed to " + path) } } - }); + }); $rootScope.$on( "$routeChangeStart", function(event, next, current) { if (next && next.templateUrl == QDR.templatePath + "qdrConnect.html" && QDRService.connected) { http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/785c5e02/console/stand-alone/plugin/js/dispatchPlugin.js ---------------------------------------------------------------------- diff --git a/console/stand-alone/plugin/js/dispatchPlugin.js b/console/stand-alone/plugin/js/dispatchPlugin.js index 5bc52b7..746fb19 100644 --- a/console/stand-alone/plugin/js/dispatchPlugin.js +++ b/console/stand-alone/plugin/js/dispatchPlugin.js @@ -179,50 +179,14 @@ var QDR = (function(QDR) { QDR.queue = d3.queue; QDRService.initProton(); - var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]); QDRService.addUpdatedAction("initChartService", function() { QDRService.delUpdatedAction("initChartService") QDRChartService.init(); // initialize charting service after we are connected }); - if (settings && settings.autostart) { - QDRService.addDisconnectAction( function () { - $timeout(function () { - var lastLocation = localStorage[QDR.LAST_LOCATION] || "/overview"; - org = lastLocation.substr(1) - $location.path("/connect"); - $location.search('org', org) - }) - }) - QDRService.addConnectAction(function() { - QDRService.getSchema(function () { - QDR.log.debug("got schema after connection") - QDRService.addUpdatedAction("initialized", function () { - QDRService.delUpdatedAction("initialized") - QDR.log.debug("got initial topology") - $timeout(function() { - 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); - } - }) - }) - QDR.log.debug("requesting a topology") - QDRService.setUpdateEntities([]) - QDRService.topology.get() - }) - }); - QDRService.connect(settings); - } else { - $timeout(function () { - $location.path('/connect') - $location.search('org', org) - }) - } + $timeout(function () { + $location.path('/connect') + $location.search('org', org) + }) $rootScope.$on('$routeChangeSuccess', function() { var path = $location.path(); http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/785c5e02/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 e33be52..499b953 100644 --- a/console/stand-alone/plugin/js/qdrSettings.js +++ b/console/stand-alone/plugin/js/qdrSettings.js @@ -113,6 +113,13 @@ QDR.log.debug(QDR.pluginRoot + "/" + goto) QDRService.connect($scope.formEntity); } + var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]); + if (settings && settings.autostart && !QDRService.connected) { + $scope.connectionError = false; + $scope.connecting = true; + doConnect() + } + }]); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org