Do not try to render home template on login/logout

This commit is contained in:
Joe Fiorini
2015-02-04 17:10:42 -05:00
parent 16119114dc
commit 109c9d8832
5 changed files with 6 additions and 24 deletions

View File

@@ -387,12 +387,12 @@ angular.module('Tower', [
}). }).
when('/login', { when('/login', {
templateUrl: urlPrefix + 'partials/home.html', templateUrl: urlPrefix + 'partials/blank.html',
controller: 'Authenticate' controller: 'Authenticate'
}). }).
when('/logout', { when('/logout', {
templateUrl: urlPrefix + 'partials/home.html', templateUrl: urlPrefix + 'partials/blank.html',
controller: 'Authenticate' controller: 'Authenticate'
}). }).

View File

@@ -1,5 +1,5 @@
angular.module('DashboardGraphs') angular.module('DashboardGraphs')
.directive('autoSizeModule', ['$window', '$timeout', function($window, $timeout) { .directive('autoSizeModule', ['$window', function($window) {
// Adjusts the size of the module so that all modules // Adjusts the size of the module so that all modules
// fit into a single a page; assumes there are 2 rows // fit into a single a page; assumes there are 2 rows
@@ -7,19 +7,8 @@ angular.module('DashboardGraphs')
// by the navbar & the count summaries module // by the navbar & the count summaries module
return function(scope, element) { return function(scope, element) {
// We need to trigger a resize on the first call
// to this when the view things load; but we don't want
// to trigger a global window resize for everything that
// has an auto resize, since they'll all pick it up with
// a single call
var triggerResize =
_.throttle(function() {
$($window).resize();
}, 1000);
function adjustSizeInitially() { function adjustSizeInitially() {
adjustSize(); adjustSize();
triggerResize();
} }
function adjustSize() { function adjustSize() {
@@ -34,17 +23,10 @@ angular.module('DashboardGraphs')
$($window).off('resize', adjustSize); $($window).off('resize', adjustSize);
}); });
// Wait a second or until dashboardReady triggers,
// whichever comes first. The timeout handles cases
// where dashboardReady never fires.
var dashboardReadyTimeout = $timeout(adjustSizeInitially, 500);
// This makes sure count-container div is loaded // This makes sure count-container div is loaded
// by controllers/Home.js before we use it // by controllers/Home.js before we use it
// to determine the available window height // to determine the available window height
scope.$on('dashboardReady', function() { scope.$on('dashboardReady', function() {
$timeout.cancel(dashboardReadyTimeout);
adjustSizeInitially(); adjustSizeInitially();
}); });

View File

@@ -40,7 +40,7 @@ function HostCountGraphData(Rest, getBasePath, processErrors, $q) {
processErrors(null, response.data, response.status, null, { hdr: 'Error!', processErrors(null, response.data, response.status, null, { hdr: 'Error!',
msg: errorMessage msg: errorMessage
}); });
return response; throw response;
}); });
} }
}; };

View File

@@ -28,7 +28,7 @@ function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope) {
hdr: 'Error!', hdr: 'Error!',
msg: errorMessage msg: errorMessage
}); });
return response; throw response;
}); });
return pluck('data', result); return pluck('data', result);

View File

@@ -1,5 +1,5 @@
<div class="tab-pane" id="home" ng-if="current_user"> <div class="tab-pane" id="home">
<div ng-cloak id="htmlTemplate" style="padding:10px"> <div ng-cloak id="htmlTemplate" style="padding:10px">
<div id="refresh-row" class="row"> <div id="refresh-row" class="row">
<div class="col-lg-12"> <div class="col-lg-12">