From 9a98b4f57313d448e1e780308dbf94c0a8f61422 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Thu, 6 Jun 2013 18:50:45 -0400 Subject: [PATCH] Cleaned up verbosity drop down options to match AC-104. Applied all Job Template changes to Job detail page. --- .../ui/static/js/controllers/JobTemplates.js | 14 ++++---- ansibleworks/ui/static/js/controllers/Jobs.js | 7 ++++ .../ui/static/js/forms/JobTemplates.js | 6 ++-- ansibleworks/ui/static/js/forms/Jobs.js | 34 +++++++++++++------ .../ui/static/lib/ansible/directives.js | 2 +- 5 files changed, 41 insertions(+), 22 deletions(-) diff --git a/ansibleworks/ui/static/js/controllers/JobTemplates.js b/ansibleworks/ui/static/js/controllers/JobTemplates.js index bc2237f5a6..2914310a37 100644 --- a/ansibleworks/ui/static/js/controllers/JobTemplates.js +++ b/ansibleworks/ui/static/js/controllers/JobTemplates.js @@ -171,10 +171,9 @@ function JobTemplatesAdd ($scope, $rootScope, $compile, $location, $log, $routeP scope.job_type_options = [{ value: 'run', label: 'Run' }, { value: 'check', label: 'Check' }]; scope.verbosity_options = [ - { value: '0', label: 'Silent' }, - { value: '1', label: 'Whisper' }, - { value: '2', label: 'Talk' }, - { value: '3', label: 'Scream' }]; + { value: '0', label: 'Default' }, + { value: '1', label: 'Verbose' }, + { value: '3', label: 'Debug' }]; scope.playbook_options = []; generator.reset(); @@ -291,10 +290,9 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route // Our job type options scope.job_type_options = [{ value: 'run', label: 'Run' }, { value: 'check', label: 'Check' }]; scope.verbosity_options = [ - { value: '0', label: 'Silent' }, - { value: '1', label: 'Whisper' }, - { value: '2', label: 'Talk' }, - { value: '3', label: 'Scream' }]; + { value: '0', label: 'Default' }, + { value: '1', label: 'Verbose' }, + { value: '3', label: 'Debug' }]; scope.playbook_options = null; scope.playbook = null; diff --git a/ansibleworks/ui/static/js/controllers/Jobs.js b/ansibleworks/ui/static/js/controllers/Jobs.js index 946af37351..9d8c8f2d37 100644 --- a/ansibleworks/ui/static/js/controllers/Jobs.js +++ b/ansibleworks/ui/static/js/controllers/Jobs.js @@ -191,10 +191,16 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, } // Set the playbook lookup getPlaybooks(scope.project); + $('#forks-slider').slider("option", "value", scope.forks); + $('#forks-slider').slider("disable"); }); // Our job type options scope.job_type_options = [{ value: 'run', label: 'Run' }, { value: 'check', label: 'Check' }]; + scope.verbosity_options = [ + { value: '0', label: 'Default' }, + { value: '1', label: 'Verbose' }, + { value: '3', label: 'Debug' }]; scope.playbook_options = null; scope.playbook = null; @@ -313,6 +319,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, for (var fld in master) { scope[fld] = master[fld]; } + $('#forks-slider').slider("option", "value", scope.forks); }; // Related set: Add button diff --git a/ansibleworks/ui/static/js/forms/JobTemplates.js b/ansibleworks/ui/static/js/forms/JobTemplates.js index e7c634b5de..b25ed0c8fe 100644 --- a/ansibleworks/ui/static/js/forms/JobTemplates.js +++ b/ansibleworks/ui/static/js/forms/JobTemplates.js @@ -97,7 +97,7 @@ angular.module('JobTemplateFormDefinition', []) addRequired: false, editRequired: false, column: 2, - awPopOver: "

Specify the number of parallel or simultaneous processes to use while executing the playbook. Provide a value between 0 and 100. " + + 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', dataPlacement: 'left' @@ -123,8 +123,8 @@ angular.module('JobTemplateFormDefinition', []) addRequired: true, editRequired: true, column: 2, - awPopOver: "

Indicate the amount of debugging type information ansible should produce as the playbook executes.

", - dataTitle: 'Forks', + awPopOver: "

Control the level of output ansible will produce as the playbook executes.

", + dataTitle: 'Verbosity', dataPlacement: 'left' }, extra_vars: { diff --git a/ansibleworks/ui/static/js/forms/Jobs.js b/ansibleworks/ui/static/js/forms/Jobs.js index 8040a10d78..0f8a158587 100644 --- a/ansibleworks/ui/static/js/forms/Jobs.js +++ b/ansibleworks/ui/static/js/forms/Jobs.js @@ -81,32 +81,46 @@ angular.module('JobFormDefinition', []) }, forks: { label: 'Forks', + id: 'forks-number', type: 'number', integer: true, min: 0, max: 100, - default: 0, + slider: true, + class: 'input-mini', + default: '0', addRequired: false, editRequired: false, - column: 2 + column: 2, + 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', + dataPlacement: 'left' }, limit: { label: 'Limit', type: 'text', addRequired: false, editRequired: false, - column: 2 + column: 2, + awPopOver: "

Provide a host pattern to further constrain the list of hosts that will be managed or affected by the playbook. " + + "Multiple patterns can be separated by ; : or ,

For more information and examples see the " + + "Selecting Targets section under Inventory and Patterns " + + " in the Ansible documentation.

", + dataTitle: 'Forks', + dataPlacement: 'left' }, verbosity: { label: 'Verbosity', - type: 'number', - integer: true, + type: 'select', + ngOptions: 'v.label for v in verbosity_options', default: 0, - min: 0, - max: 3, - addRequired: false, - editRequired: false, - column: 2 + addRequired: true, + editRequired: true, + column: 2, + awPopOver: "

Control the level of output ansible will produce as the playbook executes.

", + dataTitle: 'Verbosity', + dataPlacement: 'left' }, extra_vars: { label: 'Extra Variables', diff --git a/ansibleworks/ui/static/lib/ansible/directives.js b/ansibleworks/ui/static/lib/ansible/directives.js index 1ad3dc7b16..0e8c08da56 100644 --- a/ansibleworks/ui/static/lib/ansible/directives.js +++ b/ansibleworks/ui/static/lib/ansible/directives.js @@ -194,7 +194,7 @@ angular.module('AWDirectives', ['RestServices']) ctrl.$setValidity('max', true); ctrl.$dirty = true; ctrl.$render(); - scope['job_templates_form'].$dirty = true; + //scope['job_templates_form'].$dirty = true; if (!scope.$$phase) { scope.$digest(); }