mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
UI Automation Assistance
Fixed https://trello.com/c/WVFzq4gQ/136-multiple-working-prompts-when-loading-the-dashboard-page
This commit is contained in:
@@ -69,11 +69,9 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
|
||||
if (!$routeParams.login) {
|
||||
// If we're not logging in, start the Wait widget. Otherwise, it's already running.
|
||||
Wait('start');
|
||||
//Wait('start');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($scope.removeWidgetLoaded) {
|
||||
$scope.removeWidgetLoaded();
|
||||
}
|
||||
@@ -86,13 +84,12 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
loadedCount++;
|
||||
if (loadedCount === waitCount) {
|
||||
$(window).resize(_.debounce(function() {
|
||||
Wait('start');
|
||||
$scope.$emit('ResizeJobGraph');
|
||||
$scope.$emit('ResizeHostGraph');
|
||||
$scope.$emit('ResizeHostPieGraph');
|
||||
Wait('stop');
|
||||
}, 500));
|
||||
$(window).resize();
|
||||
Wait('stop');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -182,7 +179,6 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
$scope.$emit('dashboardReady', data);
|
||||
})
|
||||
.error(function (data, status) {
|
||||
Wait('stWaitop');
|
||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status });
|
||||
});
|
||||
};
|
||||
|
||||
@@ -359,6 +359,7 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
|
||||
pageSize = params.pageSize || 5,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
search_params = params.searchParams,
|
||||
spinner = (params.spinner === undefined) ? true : params.spinner,
|
||||
e, html, key;
|
||||
|
||||
// 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.search(list.iterator);
|
||||
scope.search(list.iterator, null, null, null, null, spinner);
|
||||
};
|
||||
}])
|
||||
|
||||
|
||||
@@ -147,14 +147,16 @@ angular.module('PaginationHelpers', ['Utilities', 'RefreshHelper', 'RefreshRelat
|
||||
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
|
||||
scope[iterator + '_page'] = 1;
|
||||
var new_url = scope[iterator + '_url'].replace(/\?page_size\=\d+/, ''),
|
||||
connect = (/\/$/.test(new_url)) ? '?' : '&';
|
||||
new_url += (scope[iterator + 'SearchParams']) ? connect + scope[iterator + 'SearchParams'] + '&page_size=' + scope[iterator + '_page_size'] :
|
||||
connect + 'page_size=' + scope[iterator + '_page_size'];
|
||||
Wait('start');
|
||||
if (spinner === undefined || spinner === true) {
|
||||
Wait('start');
|
||||
}
|
||||
Refresh({ scope: scope, set: set, iterator: iterator, url: new_url });
|
||||
};
|
||||
};
|
||||
|
||||
@@ -557,6 +557,7 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
||||
id = params.id,
|
||||
url = params.url,
|
||||
pageSize = params.pageSize || 5,
|
||||
spinner = (params.spinner === undefined) ? true : params.spinner,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
e, html;
|
||||
|
||||
@@ -627,6 +628,6 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
||||
scope[list.iterator + 'SearchFieldLabel'] = 'ID';
|
||||
}
|
||||
|
||||
scope.search(list.iterator);
|
||||
scope.search(list.iterator, null, null, null, null, spinner);
|
||||
};
|
||||
}]);
|
||||
|
||||
@@ -73,7 +73,8 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
||||
list: JobsList,
|
||||
id: 'active-jobs',
|
||||
url: GetBasePath('unified_jobs') + '?status__in=running,completed,failed,successful,error,canceled',
|
||||
pageSize: max_rows
|
||||
pageSize: max_rows,
|
||||
spinner: false
|
||||
});
|
||||
LoadSchedulesScope({
|
||||
parent_scope: scope,
|
||||
@@ -81,7 +82,8 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
||||
list: ScheduledJobsList,
|
||||
id: 'scheduled-jobs-tab',
|
||||
url: GetBasePath('schedules') + '?next_run__isnull=false',
|
||||
pageSize: max_rows
|
||||
pageSize: max_rows,
|
||||
spinner: false
|
||||
});
|
||||
|
||||
$(window).resize(_.debounce(function() {
|
||||
@@ -162,9 +164,9 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
||||
function resizeDashboardJobsWidget() {
|
||||
setDashboardJobsHeight();
|
||||
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.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator);
|
||||
scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user