mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge branch '2841' into release_3.0.0
This commit is contained in:
commit
ac5a5c574d
@ -43,6 +43,7 @@ export default
|
||||
searchable: false,
|
||||
filter: "longDate",
|
||||
key: true,
|
||||
desc: true,
|
||||
columnClass: "col-lg-4 col-md-4 col-sm-3"
|
||||
}
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
export function PortalModeJobsController($scope, $rootScope, GetBasePath, GenerateList, PortalJobsList, SearchInit,
|
||||
PaginateInit){
|
||||
|
||||
var list = _.cloneDeep(PortalJobsList),
|
||||
var list = _.cloneDeep(PortalJobsList),
|
||||
view = GenerateList,
|
||||
// show user jobs by default
|
||||
defaultUrl = GetBasePath('jobs') + '?created_by=' + $rootScope.current_user.id,
|
||||
@ -23,7 +23,8 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera
|
||||
$scope.iterator = list.iterator;
|
||||
$scope.activeFilter = 'user';
|
||||
|
||||
var init = function(sort){
|
||||
var init = function(url){
|
||||
defaultUrl = url ? url : defaultUrl;
|
||||
// We need to explicitly set the lists base path so that tag searching will keep the '?created_by'
|
||||
// query param when it's present. If we don't do this, then tag search will just grab the base
|
||||
// path for this list (/api/v1/jobs) and lose the created_by filter
|
||||
@ -49,31 +50,26 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera
|
||||
url: defaultUrl,
|
||||
pageSize: pageSize
|
||||
});
|
||||
$scope.search (list.iterator);
|
||||
if(sort) {
|
||||
// hack to default to descending sort order
|
||||
$scope.sort('job','finished');
|
||||
}
|
||||
|
||||
$scope.search(list.iterator);
|
||||
};
|
||||
|
||||
$scope.filterUser = function(){
|
||||
$scope.activeFilter = 'user';
|
||||
defaultUrl = GetBasePath('jobs') + '?created_by=' + $rootScope.current_user.id;
|
||||
init(true);
|
||||
init(defaultUrl);
|
||||
};
|
||||
|
||||
$scope.filterAll = function(){
|
||||
$scope.activeFilter = 'all';
|
||||
defaultUrl = GetBasePath('jobs');
|
||||
init(true);
|
||||
init(defaultUrl);
|
||||
};
|
||||
|
||||
$scope.refresh = function(){
|
||||
$scope.search(list.iterator);
|
||||
};
|
||||
|
||||
init(true);
|
||||
init();
|
||||
}
|
||||
|
||||
PortalModeJobsController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user