mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
Removed the resize logic that was attempting to control the number of rows show on the jobs list.
This commit is contained in:
@@ -20,8 +20,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
var jobs_scope, scheduled_scope,
|
var jobs_scope, scheduled_scope,
|
||||||
choicesCount = 0,
|
choicesCount = 0,
|
||||||
listCount = 0,
|
listCount = 0,
|
||||||
api_complete = false,
|
api_complete = false;
|
||||||
max_rows;
|
|
||||||
|
|
||||||
$scope.jobsSelected = true;
|
$scope.jobsSelected = true;
|
||||||
|
|
||||||
@@ -68,7 +67,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
list: AllJobsList,
|
list: AllJobsList,
|
||||||
id: 'active-jobs',
|
id: 'active-jobs',
|
||||||
url: GetBasePath('unified_jobs') + '?status__in=pending,waiting,running,completed,failed,successful,error,canceled',
|
url: GetBasePath('unified_jobs') + '?status__in=pending,waiting,running,completed,failed,successful,error,canceled',
|
||||||
pageSize: max_rows,
|
|
||||||
searchParams: search_params,
|
searchParams: search_params,
|
||||||
spinner: false
|
spinner: false
|
||||||
});
|
});
|
||||||
@@ -81,8 +79,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
list: ScheduledJobsList,
|
list: ScheduledJobsList,
|
||||||
id: 'scheduled-jobs-tab',
|
id: 'scheduled-jobs-tab',
|
||||||
searchSize: 'col-lg-4 col-md-4 col-sm-4 col-xs-12',
|
searchSize: 'col-lg-4 col-md-4 col-sm-4 col-xs-12',
|
||||||
url: GetBasePath('schedules') + '?next_run__isnull=false',
|
url: GetBasePath('schedules') + '?next_run__isnull=false'
|
||||||
pageSize: max_rows
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.refreshJobs = function() {
|
$scope.refreshJobs = function() {
|
||||||
@@ -121,10 +118,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
scheduled_scope.search('schedule');
|
scheduled_scope.search('schedule');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).resize(_.debounce(function() {
|
|
||||||
resizeContainers();
|
|
||||||
}, 500));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.removeChoicesReady) {
|
if ($scope.removeChoicesReady) {
|
||||||
@@ -133,7 +126,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
$scope.removeChoicesReady = $scope.$on('choicesReady', function() {
|
$scope.removeChoicesReady = $scope.$on('choicesReady', function() {
|
||||||
choicesCount++;
|
choicesCount++;
|
||||||
if (choicesCount === 2) {
|
if (choicesCount === 2) {
|
||||||
setHeight();
|
|
||||||
$scope.$emit('buildJobsList');
|
$scope.$emit('buildJobsList');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -155,46 +147,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
|
|||||||
variable: 'type_choices',
|
variable: 'type_choices',
|
||||||
callback: 'choicesReady'
|
callback: 'choicesReady'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set the height of each container and calc max number of rows containers can hold
|
|
||||||
function setHeight() {
|
|
||||||
var docw = $(window).width(),
|
|
||||||
//doch = $(window).height(),
|
|
||||||
available_height,
|
|
||||||
search_row, page_row, height, header, row_height;
|
|
||||||
$log.debug('docw: ' + docw);
|
|
||||||
|
|
||||||
// customize the container height and # of rows based on available viewport height
|
|
||||||
available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - 80;
|
|
||||||
if (docw < 1350) {
|
|
||||||
available_height = (available_height < 800) ? 800 : available_height;
|
|
||||||
} else {
|
|
||||||
available_height = (available_height < 550) ? 550 : available_height;
|
|
||||||
}
|
|
||||||
$log.debug('available_height: ' + available_height);
|
|
||||||
$('.jobs-list-container').each(function() {
|
|
||||||
$(this).height(Math.floor(available_height));
|
|
||||||
});
|
|
||||||
search_row = Math.max($('.search-row:eq(0)').outerHeight(), 50);
|
|
||||||
page_row = Math.max($('.page-row:eq(0)').outerHeight(), 33);
|
|
||||||
header = Math.max($('#active_jobs_table thead').height(), 24);
|
|
||||||
height = Math.floor(available_height ) - header - page_row - search_row - 30;
|
|
||||||
row_height = 44;
|
|
||||||
|
|
||||||
max_rows = Math.floor(height / row_height);
|
|
||||||
max_rows = (max_rows < 5) ? 5 : max_rows;
|
|
||||||
|
|
||||||
$log.debug('max_rows: ' + max_rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set container height and return the number of allowed rows
|
|
||||||
function resizeContainers() {
|
|
||||||
setHeight();
|
|
||||||
jobs_scope[AllJobsList.iterator + '_page_size'] = max_rows;
|
|
||||||
jobs_scope.changePageSize(AllJobsList.name, AllJobsList.iterator);
|
|
||||||
scheduled_scope[ScheduledJobsList.iterator + '_page_size'] = max_rows;
|
|
||||||
scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',
|
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export default
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('JobsListUpdate', ['Rest', function(Rest) {
|
.factory('JobsListUpdate', ['Rest', function(Rest) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
@@ -237,7 +237,7 @@ export default
|
|||||||
list = params.list,
|
list = params.list,
|
||||||
id = params.id,
|
id = params.id,
|
||||||
url = params.url,
|
url = params.url,
|
||||||
pageSize = params.pageSize || 5,
|
pageSize = params.pageSize || 10,
|
||||||
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, key;
|
spinner = (params.spinner === undefined) ? true : params.spinner, key;
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ export default
|
|||||||
id = params.id,
|
id = params.id,
|
||||||
url = params.url,
|
url = params.url,
|
||||||
searchSize = params.searchSize,
|
searchSize = params.searchSize,
|
||||||
pageSize = params.pageSize || 5,
|
pageSize = params.pageSize || 10,
|
||||||
spinner = (params.spinner === undefined) ? true : params.spinner;
|
spinner = (params.spinner === undefined) ? true : params.spinner;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user