Chris Houseknecht
2014-09-02 17:21:49 -04:00
parent 1ee9781ecc
commit d553a27a29
5 changed files with 16 additions and 14 deletions

View File

@@ -69,11 +69,9 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
if (!$routeParams.login) { if (!$routeParams.login) {
// If we're not logging in, start the Wait widget. Otherwise, it's already running. // If we're not logging in, start the Wait widget. Otherwise, it's already running.
Wait('start'); //Wait('start');
} }
if ($scope.removeWidgetLoaded) { if ($scope.removeWidgetLoaded) {
$scope.removeWidgetLoaded(); $scope.removeWidgetLoaded();
} }
@@ -86,13 +84,12 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
loadedCount++; loadedCount++;
if (loadedCount === waitCount) { if (loadedCount === waitCount) {
$(window).resize(_.debounce(function() { $(window).resize(_.debounce(function() {
Wait('start');
$scope.$emit('ResizeJobGraph'); $scope.$emit('ResizeJobGraph');
$scope.$emit('ResizeHostGraph'); $scope.$emit('ResizeHostGraph');
$scope.$emit('ResizeHostPieGraph'); $scope.$emit('ResizeHostPieGraph');
Wait('stop');
}, 500)); }, 500));
$(window).resize(); $(window).resize();
Wait('stop');
} }
}); });
@@ -182,7 +179,6 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
$scope.$emit('dashboardReady', data); $scope.$emit('dashboardReady', data);
}) })
.error(function (data, status) { .error(function (data, status) {
Wait('stWaitop');
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status });
}); });
}; };

View File

@@ -359,6 +359,7 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
pageSize = params.pageSize || 5, pageSize = params.pageSize || 5,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
search_params = params.searchParams, search_params = params.searchParams,
spinner = (params.spinner === undefined) ? true : params.spinner,
e, html, key; e, html, key;
// Add the search widget. We want it arranged differently, so we're injecting and compiling it separately // Add the search widget. We want it arranged differently, so we're injecting and compiling it separately
@@ -416,7 +417,7 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
scope[key] = search_params[key]; scope[key] = search_params[key];
} }
} }
scope.search(list.iterator); scope.search(list.iterator, null, null, null, null, spinner);
}; };
}]) }])

View File

@@ -147,14 +147,16 @@ angular.module('PaginationHelpers', ['Utilities', 'RefreshHelper', 'RefreshRelat
return (page === scope[iterator + '_page']) ? 'active' : ''; return (page === scope[iterator + '_page']) ? 'active' : '';
}; };
scope.changePageSize = function (set, iterator) { scope.changePageSize = function (set, iterator, spinner) {
// Called whenever a new page size is selected // Called whenever a new page size is selected
scope[iterator + '_page'] = 1; scope[iterator + '_page'] = 1;
var new_url = scope[iterator + '_url'].replace(/\?page_size\=\d+/, ''), var new_url = scope[iterator + '_url'].replace(/\?page_size\=\d+/, ''),
connect = (/\/$/.test(new_url)) ? '?' : '&'; connect = (/\/$/.test(new_url)) ? '?' : '&';
new_url += (scope[iterator + 'SearchParams']) ? connect + scope[iterator + 'SearchParams'] + '&page_size=' + scope[iterator + '_page_size'] : new_url += (scope[iterator + 'SearchParams']) ? connect + scope[iterator + 'SearchParams'] + '&page_size=' + scope[iterator + '_page_size'] :
connect + 'page_size=' + scope[iterator + '_page_size']; connect + 'page_size=' + scope[iterator + '_page_size'];
if (spinner === undefined || spinner === true) {
Wait('start'); Wait('start');
}
Refresh({ scope: scope, set: set, iterator: iterator, url: new_url }); Refresh({ scope: scope, set: set, iterator: iterator, url: new_url });
}; };
}; };

View File

@@ -557,6 +557,7 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
id = params.id, id = params.id,
url = params.url, url = params.url,
pageSize = params.pageSize || 5, pageSize = params.pageSize || 5,
spinner = (params.spinner === undefined) ? true : params.spinner,
base = $location.path().replace(/^\//, '').split('/')[0], base = $location.path().replace(/^\//, '').split('/')[0],
e, html; e, html;
@@ -627,6 +628,6 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
scope[list.iterator + 'SearchFieldLabel'] = 'ID'; scope[list.iterator + 'SearchFieldLabel'] = 'ID';
} }
scope.search(list.iterator); scope.search(list.iterator, null, null, null, null, spinner);
}; };
}]); }]);

View File

@@ -73,7 +73,8 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
list: JobsList, list: JobsList,
id: 'active-jobs', id: 'active-jobs',
url: GetBasePath('unified_jobs') + '?status__in=running,completed,failed,successful,error,canceled', url: GetBasePath('unified_jobs') + '?status__in=running,completed,failed,successful,error,canceled',
pageSize: max_rows pageSize: max_rows,
spinner: false
}); });
LoadSchedulesScope({ LoadSchedulesScope({
parent_scope: scope, parent_scope: scope,
@@ -81,7 +82,8 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
list: ScheduledJobsList, list: ScheduledJobsList,
id: 'scheduled-jobs-tab', id: 'scheduled-jobs-tab',
url: GetBasePath('schedules') + '?next_run__isnull=false', url: GetBasePath('schedules') + '?next_run__isnull=false',
pageSize: max_rows pageSize: max_rows,
spinner: false
}); });
$(window).resize(_.debounce(function() { $(window).resize(_.debounce(function() {
@@ -162,9 +164,9 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
function resizeDashboardJobsWidget() { function resizeDashboardJobsWidget() {
setDashboardJobsHeight(); setDashboardJobsHeight();
jobs_scope[JobsList.iterator + '_page_size'] = max_rows; jobs_scope[JobsList.iterator + '_page_size'] = max_rows;
jobs_scope.changePageSize(JobsList.name, JobsList.iterator); jobs_scope.changePageSize(JobsList.name, JobsList.iterator, false);
scheduled_scope[ScheduledJobsList.iterator + '_page_size'] = max_rows; scheduled_scope[ScheduledJobsList.iterator + '_page_size'] = max_rows;
scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator); scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator, false);
} }