mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -02:30
fixed scan job and job run type ordering
This commit is contained in:
@@ -346,6 +346,25 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
|||||||
// this sets the default options for the selects as specified by the controller.
|
// this sets the default options for the selects as specified by the controller.
|
||||||
$scope.verbosity = $scope.verbosity_options[$scope.verbosity_field.default];
|
$scope.verbosity = $scope.verbosity_options[$scope.verbosity_field.default];
|
||||||
$scope.job_type = $scope.job_type_options[$scope.job_type_field.default];
|
$scope.job_type = $scope.job_type_options[$scope.job_type_field.default];
|
||||||
|
|
||||||
|
// if you're getting to the form from the scan job section on inventories,
|
||||||
|
// set the job type select to be scan
|
||||||
|
if ($routeParams.inventory_id) {
|
||||||
|
// This means that the job template form was accessed via inventory prop's
|
||||||
|
// This also means the job is a scan job.
|
||||||
|
$scope.job_type.value = 'scan';
|
||||||
|
$scope.jobTypeChange();
|
||||||
|
$scope.inventory = $routeParams.inventory_id;
|
||||||
|
Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/');
|
||||||
|
Rest.get()
|
||||||
|
.success(function (data) {
|
||||||
|
$scope.inventory_name = data.name;
|
||||||
|
})
|
||||||
|
.error(function (data, status) {
|
||||||
|
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||||
|
msg: 'Failed to lookup inventory: ' + data.id + '. GET returned status: ' + status });
|
||||||
|
});
|
||||||
|
}
|
||||||
$scope.$emit('lookUpInitialize');
|
$scope.$emit('lookUpInitialize');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -424,23 +443,6 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($routeParams.inventory_id) {
|
|
||||||
// This means that the job template form was accessed via inventory prop's
|
|
||||||
// This also means the job is a scan job.
|
|
||||||
$scope.job_type.value = 'scan';
|
|
||||||
$scope.jobTypeChange();
|
|
||||||
$scope.inventory = $routeParams.inventory_id;
|
|
||||||
Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/');
|
|
||||||
Rest.get()
|
|
||||||
.success(function (data) {
|
|
||||||
$scope.inventory_name = data.name;
|
|
||||||
})
|
|
||||||
.error(function (data, status) {
|
|
||||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
|
||||||
msg: 'Failed to lookup inventory: ' + data.id + '. GET returned status: ' + status });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Detect and alert user to potential SCM status issues
|
// Detect and alert user to potential SCM status issues
|
||||||
checkSCMStatus = function (oldValue, newValue) {
|
checkSCMStatus = function (oldValue, newValue) {
|
||||||
if (oldValue !== newValue && !Empty($scope.project)) {
|
if (oldValue !== newValue && !Empty($scope.project)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user