diff --git a/awx/ui/static/css/ansible-ui.css b/awx/ui/static/css/ansible-ui.css index 626474e2b4..6fc10dfd47 100644 --- a/awx/ui/static/css/ansible-ui.css +++ b/awx/ui/static/css/ansible-ui.css @@ -82,7 +82,7 @@ font-size: 16px; text-align: center; color: #0088cc; - margin-bottom: 15px; + margin-bottom: 25px; } .controls { diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 8d9f75a43d..c748d339fa 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -208,7 +208,7 @@ function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeP scope.formReset = function() { // Defaults generator.reset(); - $('#forks-slider').slider("option", "value", scope.forks); + //$('#forks-slider').slider("option", "value", scope.forks); for (var fld in master) { scope[fld] = master[fld]; } @@ -293,7 +293,7 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route scope.search(relatedSets[set].iterator); } getPlaybooks(scope.project); - $('#forks-slider').slider('value',scope.forks); // align slider handle with value. + //$('#forks-slider').slider('value',scope.forks); // align slider handle with value. var dft = (scope['host_config_key'] === "" || scope['host_config_key'] === null) ? 'false' : 'true'; md5Setup({ @@ -444,7 +444,7 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route scope[fld] = master[fld]; } scope.parseType = 'yaml'; - $('#forks-slider').slider("option", "value", scope.forks); + //$('#forks-slider').slider("option", "value", scope.forks); }; // Related set: Add button diff --git a/awx/ui/static/js/forms/JobTemplates.js b/awx/ui/static/js/forms/JobTemplates.js index 80f28e0030..bbddc2d940 100644 --- a/awx/ui/static/js/forms/JobTemplates.js +++ b/awx/ui/static/js/forms/JobTemplates.js @@ -90,12 +90,12 @@ angular.module('JobTemplateFormDefinition', []) type: 'number', integer: true, min: 0, - max: 100000000, - slider: true, - "class": 'input-mini', + max: null, + spinner: true, "default": '0', addRequired: false, editRequired: false, + class: "input-small", column: 1, awPopOver: "
The number of parallel or simultaneous processes to use while executing the playbook. Provide a value between 0 and 100. " + "A value of zero will use the ansible default setting of 5 parallel processes.
", @@ -171,7 +171,6 @@ angular.module('JobTemplateFormDefinition', []) trueValue: 'true', falseValue: 'false', ngChange: "toggleCallback('host_config_key')", - "class": "span12", column: 2, awPopOver: "Create a callback URL a host can use to contact the AWX server and request a configuration update " + "using the job template. The URL will look like the following:
\n" + diff --git a/awx/ui/static/js/forms/Jobs.js b/awx/ui/static/js/forms/Jobs.js index 8ab4c89fd9..c3883751a9 100644 --- a/awx/ui/static/js/forms/Jobs.js +++ b/awx/ui/static/js/forms/Jobs.js @@ -90,13 +90,14 @@ angular.module('JobFormDefinition', []) type: 'number', integer: true, min: 0, - max: 100, - slider: true, - "class": 'input-mini', + max: null, + spinner: true, + "class": 'input-small', "default": '0', addRequired: false, editRequired: false, column: 1, + disabled: true, awPopOver: "The number of parallel or simultaneous processes to use while executing the playbook. Provide a value between 0 and 100. " + "A value of zero will use the ansible default setting of 5 parallel processes.
", dataTitle: 'Forks', diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 075a9448eb..1f4e04c85f 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -260,6 +260,51 @@ angular.module('AWDirectives', ['RestServices']) }); + } + } + }]) + + // + // Enable jqueryui spinner widget on a numeric input field + // + // + // + .directive('ngSpinner', [ function() { + return { + require: 'ngModel', + link: function(scope, elm, attrs, ctrl) { + var name = elm.attr('name'); + var disabled = elm.attr('data-disabled'); + var opts = { + value: 0, + step: 1, + min: elm.attr('min'), + max: elm.attr('max'), + numberFormat: "d", + spin: function(e, u) { + ctrl.$setViewValue(u.value); + ctrl.$setValidity('required',true); + ctrl.$setValidity('min', true); + ctrl.$setValidity('max', true); + ctrl.$dirty = true; + ctrl.$render(); + scope['job_templates_form'].$dirty = true; + if (!scope.$$phase) { + scope.$digest(); + } + } + }; + if (disabled) { + opts['disabled'] = true; + } + + $(elm).spinner(opts); + + /*$('#' + name + '-number').change( function() { + $('#' + name + '-slider').slider('value', parseInt( $(this).val() )); + });*/ + + } } }]); diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index c9a19ce69c..84ec31ce5b 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -395,9 +395,12 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) html += "