Move host count graph into directive

This commit is contained in:
Joe Fiorini
2015-01-26 12:02:03 -05:00
parent f98e9ce0c7
commit 408d9bf136
8 changed files with 213 additions and 53 deletions

View File

@@ -25,7 +25,7 @@
* Host count graph should only be loaded if the user is a super user
*
*/
function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, DashboardCounts, HostGraph, DashboardJobs,
function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, DashboardCounts, DashboardJobs,
ClearScope, Stream, Rest, GetBasePath, ProcessErrors, Button, graphData){
ClearScope('home');
@@ -84,7 +84,6 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
loadedCount++;
if (loadedCount === waitCount) {
$(window).resize(_.debounce(function() {
$scope.$emit('ResizeHostGraph');
Wait('stop');
}, 500));
$(window).resize();
@@ -118,15 +117,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
$scope.graphData = graphData;
if ($rootScope.user_is_superuser === true) {
waitCount = 5;
HostGraph({
scope: $scope,
target: 'dash-host-count-graph',
dashboard: data
});
}
else{
if ($rootScope.user_is_superuser !== true) {
$('#dash-host-count-graph').remove(); //replaceWith("<div id='dash-host-count-graph' class='left-side col-sm-12 col-xs-12'></div>");
}
DashboardJobs({
@@ -178,7 +169,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
}
Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', '$log','Wait', 'DashboardCounts', 'HostGraph', 'DashboardJobs',
Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', '$log','Wait', 'DashboardCounts', 'DashboardJobs',
'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', 'Button', 'graphData'
];