mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
supply missing providers, resolves #1590
This commit is contained in:
@@ -35,12 +35,15 @@ export default
|
|||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService){
|
features: ['FeaturesService', function(FeaturesService){
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}]
|
}],
|
||||||
|
JobTemplateExtraVars: function(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
name: 'managementJobSchedules.edit',
|
name: 'managementJobSchedules.edit',
|
||||||
route: '/add',
|
route: '/edit/:schedule_id',
|
||||||
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
|
templateUrl: templateUrl('management-jobs/scheduler/schedulerForm'),
|
||||||
controller: 'managementJobEditController',
|
controller: 'managementJobEditController',
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default
|
|||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
return Rest.get().then(function(res){
|
return Rest.get().then(function(res){
|
||||||
// handle unescaped newlines
|
// handle unescaped newlines
|
||||||
return JSON.parse(JSON.stringify(res.data.extra_vars))
|
return JSON.parse(JSON.stringify(res.data.extra_vars));
|
||||||
});
|
});
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,10 @@ export default
|
|||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}]
|
}],
|
||||||
|
JobTemplateExtraVars: function(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
@@ -75,7 +78,10 @@ export default
|
|||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
}]
|
}],
|
||||||
|
JobTemplateExtraVars: function(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$stateExtender.addState({
|
$stateExtender.addState({
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s
|
|||||||
$scope.$on("ScheduleFormCreated", function(e, scope) {
|
$scope.$on("ScheduleFormCreated", function(e, scope) {
|
||||||
$scope.hideForm = false;
|
$scope.hideForm = false;
|
||||||
$scope = angular.extend($scope, scope);
|
$scope = angular.extend($scope, scope);
|
||||||
|
|
||||||
$scope.$on("formUpdated", function() {
|
$scope.$on("formUpdated", function() {
|
||||||
$rootScope.$broadcast("loadSchedulerDetailPane");
|
$rootScope.$broadcast("loadSchedulerDetailPane");
|
||||||
});
|
});
|
||||||
@@ -46,29 +45,32 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s
|
|||||||
$state.go("^");
|
$state.go("^");
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.parseType = 'yaml';
|
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||||
$scope.extraVars = JobTemplateExtraVars === '' ? '---' : JobTemplateExtraVars;
|
if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){
|
||||||
ParseTypeChange({
|
$scope.parseType = 'yaml';
|
||||||
scope: $scope,
|
$scope.extraVars = JobTemplateExtraVars === '' || JobTemplateExtraVars === null ? '---' : JobTemplateExtraVars;
|
||||||
variable: 'extraVars',
|
ParseTypeChange({
|
||||||
parse_variable: 'parseType',
|
scope: $scope,
|
||||||
field_id: 'SchedulerForm-extraVars'
|
variable: 'extraVars',
|
||||||
});
|
parse_variable: 'parseType',
|
||||||
|
field_id: 'SchedulerForm-extraVars'
|
||||||
|
});
|
||||||
|
$scope.$watch('extraVars', function(){
|
||||||
|
if ($scope.parseType === 'yaml'){
|
||||||
|
try{
|
||||||
|
$scope.serializedExtraVars = jsyaml.safeLoad($scope.extraVars);
|
||||||
|
}
|
||||||
|
catch(err){ return; }
|
||||||
|
}
|
||||||
|
else if ($scope.parseType === 'json'){
|
||||||
|
try{
|
||||||
|
$scope.serializedExtraVars = JSON.parse($scope.extraVars);
|
||||||
|
}
|
||||||
|
catch(err){ return; }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.$watch('extraVars', function(){
|
|
||||||
if ($scope.parseType === 'yaml'){
|
|
||||||
try{
|
|
||||||
$scope.serializedExtraVars = jsyaml.safeLoad($scope.extraVars);
|
|
||||||
}
|
|
||||||
catch(err){ return; }
|
|
||||||
}
|
|
||||||
else if ($scope.parseType === 'json'){
|
|
||||||
try{
|
|
||||||
$scope.serializedExtraVars = JSON.parse($scope.extraVars);
|
|
||||||
}
|
|
||||||
catch(err){ return; }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
AddSchedule({
|
AddSchedule({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
@@ -88,4 +90,5 @@ export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$s
|
|||||||
});
|
});
|
||||||
|
|
||||||
callSelect2();
|
callSelect2();
|
||||||
|
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -48,41 +48,44 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$
|
|||||||
$state.go("^");
|
$state.go("^");
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$on('ScheduleFound', function(){
|
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||||
if ($scope.parseType === 'yaml'){
|
if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){
|
||||||
try{
|
$scope.$on('ScheduleFound', function(){
|
||||||
$scope.extraVars = '---\n' + jsyaml.safeDump($scope.serializedExtraVars);
|
if ($scope.parseType === 'yaml'){
|
||||||
|
try{
|
||||||
|
$scope.extraVars = '---\n' + jsyaml.safeDump($scope.serializedExtraVars);
|
||||||
|
}
|
||||||
|
catch(err){ return; }
|
||||||
}
|
}
|
||||||
catch(err){ return; }
|
else if ($scope.parseType === 'json'){
|
||||||
}
|
try{
|
||||||
else if ($scope.parseType === 'json'){
|
$scope.extraVars = JSON.stringify($scope.serializedExtraVars, null, ' ');
|
||||||
try{
|
}
|
||||||
$scope.extraVars = JSON.stringify($scope.serializedExtraVars, null, ' ');
|
catch(err){ return; }
|
||||||
}
|
}
|
||||||
catch(err){ return; }
|
ParseTypeChange({
|
||||||
}
|
scope: $scope,
|
||||||
ParseTypeChange({
|
variable: 'extraVars',
|
||||||
scope: $scope,
|
parse_variable: 'parseType',
|
||||||
variable: 'extraVars',
|
field_id: 'SchedulerForm-extraVars'
|
||||||
parse_variable: 'parseType',
|
});
|
||||||
field_id: 'SchedulerForm-extraVars'
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
$scope.$watch('extraVars', function(){
|
||||||
$scope.$watch('extraVars', function(){
|
if ($scope.parseType === 'yaml'){
|
||||||
if ($scope.parseType === 'yaml'){
|
try{
|
||||||
try{
|
$scope.serializedExtraVars = jsyaml.safeLoad($scope.extraVars);
|
||||||
$scope.serializedExtraVars = jsyaml.safeLoad($scope.extraVars);
|
}
|
||||||
|
catch(err){ return; }
|
||||||
}
|
}
|
||||||
catch(err){ return; }
|
else if ($scope.parseType === 'json'){
|
||||||
}
|
try{
|
||||||
else if ($scope.parseType === 'json'){
|
$scope.serializedExtraVars = JSON.parse($scope.extraVars);
|
||||||
try{
|
}
|
||||||
$scope.serializedExtraVars = JSON.parse($scope.extraVars);
|
catch(err){ return; }
|
||||||
}
|
}
|
||||||
catch(err){ return; }
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
EditSchedule({
|
EditSchedule({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
|
|||||||
Reference in New Issue
Block a user