mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Jobs page- schedules layout now works with new page layout. Refined page auto-resize.
This commit is contained in:
@@ -359,6 +359,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
CallbackHelpInit({ scope: $scope });
|
CallbackHelpInit({ scope: $scope });
|
||||||
|
|
||||||
|
SchedulesList.well = false;
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
|
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
|
|||||||
@@ -129,25 +129,18 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
var docw = $(document).width(),
|
var docw = $(document).width(),
|
||||||
available_height,
|
available_height,
|
||||||
search_row, page_row, height, header, row_height, rows;
|
search_row, page_row, height, header, row_height, rows;
|
||||||
|
|
||||||
if (docw > 1240) {
|
if (docw > 1240) {
|
||||||
// customize the container height and # of rows based on available viewport height
|
// customize the container height and # of rows based on available viewport height
|
||||||
available_height = $('#wrap').height() - $('#main_tabs').height() - $('#breadcrumbs').outerHeight() - $('.site-footer').outerHeight() - 15;
|
available_height = $(window).height() - $('.main-menu').outerHeight() - $('#main_tabs').outerHeight() - $('#breadcrumbs').outerHeight() - $('.site-footer').outerHeight() - 25;
|
||||||
$('.jobs-list-container').each(function() {
|
$('.jobs-list-container').each(function() {
|
||||||
$(this).height(Math.floor(available_height / 2));
|
$(this).height(Math.floor(available_height / 2));
|
||||||
});
|
});
|
||||||
search_row = $('.search-row:eq(0)').outerHeight();
|
search_row = $('.search-row:eq(0)').outerHeight();
|
||||||
page_row = $('.page-row:eq(0)').outerHeight();
|
page_row = $('.page-row:eq(0)').outerHeight();
|
||||||
header = $('#completed_jobs_table thead').height();
|
header = $('#completed_jobs_table thead').height();
|
||||||
height = Math.floor(available_height / 2) - header - page_row - search_row;
|
height = Math.floor(available_height / 2) - header - page_row - search_row - 15;
|
||||||
row_height = $('.jobs-list-container tbody tr:eq(0)').height();
|
row_height = $('.jobs-list-container tbody tr:eq(0)').height();
|
||||||
rows = Math.floor(height / row_height);
|
rows = Math.floor(height / row_height);
|
||||||
completed_scope[CompletedJobsList.iterator + '_page_size'] = rows;
|
|
||||||
completed_scope.changePageSize(CompletedJobsList.name, CompletedJobsList.iterator);
|
|
||||||
running_scope[RunningJobsList.iterator + '_page_size'] = rows;
|
|
||||||
running_scope.changePageSize(RunningJobsList.name, RunningJobsList.iterator);
|
|
||||||
queued_scope[QueuedJobsList.iterator + '_page_size'] = rows;
|
|
||||||
queued_scope.changePageSize(QueuedJobsList.name, QueuedJobsList.iterator);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// when width < 1240px put things back to their default state
|
// when width < 1240px put things back to their default state
|
||||||
@@ -155,13 +148,15 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
$(this).css({ 'height': 'auto' });
|
$(this).css({ 'height': 'auto' });
|
||||||
});
|
});
|
||||||
rows = 5;
|
rows = 5;
|
||||||
|
}
|
||||||
completed_scope[CompletedJobsList.iterator + '_page_size'] = rows;
|
completed_scope[CompletedJobsList.iterator + '_page_size'] = rows;
|
||||||
completed_scope.changePageSize(CompletedJobsList.name, CompletedJobsList.iterator);
|
completed_scope.changePageSize(CompletedJobsList.name, CompletedJobsList.iterator);
|
||||||
running_scope[RunningJobsList.iterator + '_page_size'] = rows;
|
running_scope[RunningJobsList.iterator + '_page_size'] = rows;
|
||||||
running_scope.changePageSize(RunningJobsList.name, RunningJobsList.iterator);
|
running_scope.changePageSize(RunningJobsList.name, RunningJobsList.iterator);
|
||||||
queued_scope[QueuedJobsList.iterator + '_page_size'] = rows;
|
queued_scope[QueuedJobsList.iterator + '_page_size'] = rows;
|
||||||
queued_scope.changePageSize(QueuedJobsList.name, QueuedJobsList.iterator);
|
queued_scope.changePageSize(QueuedJobsList.name, QueuedJobsList.iterator);
|
||||||
}
|
scheduled_scope[ScheduledJobsList.iterator + '_page_size'] = rows;
|
||||||
|
scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get
|
|||||||
$compile(e)($scope);
|
$compile(e)($scope);
|
||||||
|
|
||||||
url += "schedules/";
|
url += "schedules/";
|
||||||
|
SchedulesList.well = true;
|
||||||
LoadSchedulesScope({
|
LoadSchedulesScope({
|
||||||
parent_scope: $scope,
|
parent_scope: $scope,
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog' ])
|
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||||
|
'GeneratorHelpers'])
|
||||||
|
|
||||||
.factory('ShowSchedulerModal', ['Wait', 'CreateDialog', function(Wait, CreateDialog) {
|
.factory('ShowSchedulerModal', ['Wait', 'CreateDialog', function(Wait, CreateDialog) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
@@ -541,16 +542,37 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
|||||||
* Called from a controller to setup the scope for a schedules list
|
* Called from a controller to setup the scope for a schedules list
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.factory('LoadSchedulesScope', ['$routeParams','SearchInit', 'PaginateInit', 'GenerateList', 'SchedulesControllerInit', 'SchedulesListInit',
|
.factory('LoadSchedulesScope', ['$compile', '$location', '$routeParams','SearchInit', 'PaginateInit', 'GenerateList', 'SchedulesControllerInit',
|
||||||
function($routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) {
|
'SchedulesListInit', 'SearchWidget',
|
||||||
|
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit, SearchWidget) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var parent_scope = params.parent_scope,
|
var parent_scope = params.parent_scope,
|
||||||
scope = params.scope,
|
scope = params.scope,
|
||||||
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 || 5,
|
||||||
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
|
e, html;
|
||||||
|
|
||||||
|
if (base === 'jobs') {
|
||||||
|
// on jobs page the search widget appears on the right
|
||||||
|
html = SearchWidget({
|
||||||
|
iterator: list.iterator,
|
||||||
|
template: params.list,
|
||||||
|
includeSize: false
|
||||||
|
});
|
||||||
|
e = angular.element(document.getElementById(id + '-search-container')).append(html);
|
||||||
|
$compile(e)(scope);
|
||||||
|
GenerateList.inject(list, {
|
||||||
|
mode: 'edit',
|
||||||
|
id: id,
|
||||||
|
breadCrumbs: false,
|
||||||
|
scope: scope,
|
||||||
|
showSearch: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
GenerateList.inject(list, {
|
GenerateList.inject(list, {
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
id: id,
|
id: id,
|
||||||
@@ -559,6 +581,7 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
|||||||
searchSize: 'col-lg-4 col-md-6 col-sm-12 col-xs-12',
|
searchSize: 'col-lg-4 col-md-6 col-sm-12 col-xs-12',
|
||||||
showSearch: true
|
showSearch: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
SearchInit({
|
SearchInit({
|
||||||
scope: scope,
|
scope: scope,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ angular.module('SchedulesListDefinition', [])
|
|||||||
iterator: 'schedule',
|
iterator: 'schedule',
|
||||||
selectTitle: '',
|
selectTitle: '',
|
||||||
editTitle: 'Schedules',
|
editTitle: 'Schedules',
|
||||||
well: true,
|
well: false,
|
||||||
index: true,
|
index: true,
|
||||||
hover: true,
|
hover: true,
|
||||||
|
|
||||||
@@ -46,9 +46,8 @@ angular.module('SchedulesListDefinition', [])
|
|||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
key: true,
|
searchType: 'int',
|
||||||
desc: true,
|
searchOnly: true
|
||||||
searchType: 'int'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -740,7 +740,7 @@ select.page-size {
|
|||||||
/* breadcrumbs */
|
/* breadcrumbs */
|
||||||
.nav-path {
|
.nav-path {
|
||||||
padding: 5px 0 10px 0;
|
padding: 5px 0 10px 0;
|
||||||
margin-right: 5px;
|
margin-right: 2px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
Reference in New Issue
Block a user