mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 14:11:24 -03:30
Merge pull request #4776 from jaredevantabor/portal-mode
fixing filter and sockets for portal jobs
This commit is contained in:
commit
94b9d6f95a
@ -9,27 +9,25 @@ export function PortalModeJobsController($scope, $rootScope, $state, $stateParam
|
||||
var list = PortalJobsList;
|
||||
|
||||
$scope.$on('ws-jobs', function() {
|
||||
// @issue: OLD SEARCH
|
||||
//$scope.search('job');
|
||||
});
|
||||
if ($rootScope.removeJobStatusChange) {
|
||||
$rootScope.removeJobStatusChange();
|
||||
}
|
||||
$rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange-portal', function() {
|
||||
$state.go('.', null, { reload: true });
|
||||
});
|
||||
|
||||
init();
|
||||
|
||||
function init() {
|
||||
function init(data) {
|
||||
let d = (!data) ? Dataset : data;
|
||||
// search init
|
||||
$scope.list = list;
|
||||
$scope[`${list.iterator}_dataset`] = Dataset.data;
|
||||
$scope[`${list.iterator}_dataset`] = d.data;
|
||||
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
||||
|
||||
$scope.iterator = list.iterator;
|
||||
}
|
||||
|
||||
$scope.$on('filterPortalJobs', function(e, data){
|
||||
init(data);
|
||||
});
|
||||
|
||||
$scope.refresh = function() {
|
||||
$state.go('.', null, {reload: true});
|
||||
};
|
||||
|
||||
@ -47,14 +47,18 @@ export default {
|
||||
$scope.activeFilter = 'user';
|
||||
path = GetBasePath('jobs');
|
||||
$stateParams.job_search.created_by = $rootScope.current_user.id;
|
||||
qs.search(path, $stateParams.job_search);
|
||||
qs.search(path, $stateParams.job_search).then((response) => {
|
||||
$scope.$broadcast('filterPortalJobs', response);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.filterAll = function() {
|
||||
$scope.activeFilter = 'all';
|
||||
delete $stateParams.job_search.created_by;
|
||||
path = GetBasePath('jobs');
|
||||
qs.search(path, $stateParams.job_search);
|
||||
qs.search(path, $stateParams.job_search).then((response) => {
|
||||
$scope.$broadcast('filterPortalJobs', response);
|
||||
});
|
||||
};
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user