diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index 0708e6f196..83fc8db386 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -71,7 +71,7 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea } $scope.removeChoicesReady = $scope.$on('choicesReady', function() { choicesCount++; - if (choicesCount === 3) { + if (choicesCount === 2) { $scope.$emit('buildJobsList'); } }); diff --git a/awx/ui/static/js/controllers/Schedules.js b/awx/ui/static/js/controllers/Schedules.js index 560c22b3b2..f13818aad3 100644 --- a/awx/ui/static/js/controllers/Schedules.js +++ b/awx/ui/static/js/controllers/Schedules.js @@ -11,7 +11,7 @@ 'use strict'; function ScheduleEditController($scope, $compile, $location, $routeParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, -GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope) { +GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices) { ClearScope(); @@ -54,21 +54,36 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope) { }); }); - // Load the parent object + + if ($scope.removeChoicesReady) { + $scope.removeChocesReady(); + } + $scope.removeChoicesReady = $scope.$on('choicesReady', function() { + // Load the parent object + id = $routeParams.id; + url = GetBasePath(base) + id + '/'; + Rest.setUrl(url); + Rest.get() + .success(function(data) { + parentObject = data; + $scope.$emit('ParentLoaded'); + }) + .error(function(data, status) { + ProcessErrors($scope, data, status, null, { hdr: 'Error!', + msg: 'Call to ' + url + ' failed. GET returned: ' + status }); + }); + }); + Wait('start'); - id = $routeParams.id; - url = GetBasePath(base) + id + '/'; - Rest.setUrl(url); - Rest.get() - .success(function(data) { - parentObject = data; - $scope.$emit('ParentLoaded'); - }) - .error(function(data, status) { - ProcessErrors($scope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + ' failed. GET returned: ' + status }); - }); + + GetChoices({ + scope: $scope, + url: GetBasePath('unified_jobs'), //'/static/sample/data/types/data.json' + field: 'type', + variable: 'type_choices', + callback: 'choicesReady' + }); } ScheduleEditController.$inject = [ '$scope', '$compile', '$location', '$routeParams', 'SchedulesList', 'Rest', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', - 'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope' ]; \ No newline at end of file + 'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope', 'GetChoices' ]; \ No newline at end of file diff --git a/awx/ui/static/js/helpers/Jobs.js b/awx/ui/static/js/helpers/Jobs.js index dda3e190ce..2221ed40a0 100644 --- a/awx/ui/static/js/helpers/Jobs.js +++ b/awx/ui/static/js/helpers/Jobs.js @@ -28,8 +28,14 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job DeleteJob({ scope: scope, id: id }); }; - scope.relaunchJob = function(id) { + scope.relaunchJob = function(event, id) { var list, job, typeId; + try { + $(event.target).tooltip('hide'); + } + catch(e) { + //ignore + } if (scope.completed_jobs) { list = scope.completed_jobs; } @@ -355,11 +361,6 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job } } } - - itm.status_popover_title = itm.status_label; - itm.status_popover = "

" + itm.job_explanation + "

\n" + - "

More...

\n" + - "
esc or click to close
\n"; }); parent_scope.$emit('listLoaded'); }); @@ -473,15 +474,4 @@ function(Find, Wait, Rest, InventoryUpdate, ProcessErrors, GetBasePath) { id = params.id; ProjectUpdate({ scope: scope, project_id: id }); }; -}]) - -.factory('ScheduledJobEdit', ['Find', 'EditSchedule', 'GetBasePath', function(Find, EditSchedule, GetBasePath) { - return function(params) { - var scope = params.scope, - id = params.id, - url = GetBasePath('schedules'), - schedule = Find({ list: scope.scheduled_jobs, key: 'id', val: id }); - EditSchedule({ scope: scope, schedule: schedule, url: url }); - }; }]); - diff --git a/awx/ui/static/js/helpers/Schedules.js b/awx/ui/static/js/helpers/Schedules.js index 52367cde16..7b26869e04 100644 --- a/awx/ui/static/js/helpers/Schedules.js +++ b/awx/ui/static/js/helpers/Schedules.js @@ -521,6 +521,18 @@ angular.module('SchedulesHelper', ['Utilities', 'RestServices', 'SchedulesHelper itm.status = 'stopped'; itm.status_tip = 'Schedule is temporarily stopped. Click to activate.'; } + + // Set the item type label + if (list.fields.type) { + parent_scope.type_choices.every(function(choice) { + if (choice.value === item.type) { + itm.type_label = choice.label; + return false; + } + return true; + }); + } + // Copy summary_field values for (field in list.fields) { fld = list.fields[field]; diff --git a/awx/ui/static/js/lists/CompletedJobs.js b/awx/ui/static/js/lists/CompletedJobs.js index 294f8f419b..30b871b02d 100644 --- a/awx/ui/static/js/lists/CompletedJobs.js +++ b/awx/ui/static/js/lists/CompletedJobs.js @@ -63,7 +63,8 @@ angular.module('CompletedJobsDefinition', []) label: 'Type', ngBind: 'completed_job.type_label', link: false, - columnClass: "col-md-2 hidden-sm hidden-xs" + columnClass: "col-md-2 hidden-sm hidden-xs", + searchable: false }, name: { label: 'Name', @@ -93,7 +94,7 @@ angular.module('CompletedJobsDefinition', []) submit: { icon: 'icon-rocket', mode: 'all', - ngClick: 'relaunchJob(completed_job.id)', + ngClick: 'relaunchJob($event, completed_job.id)', awToolTip: 'Relaunch using the same parameters', dataPlacement: 'top' }, diff --git a/awx/ui/static/js/lists/QueuedJobs.js b/awx/ui/static/js/lists/QueuedJobs.js index 60179715c2..49dc273c94 100644 --- a/awx/ui/static/js/lists/QueuedJobs.js +++ b/awx/ui/static/js/lists/QueuedJobs.js @@ -54,7 +54,8 @@ angular.module('QueuedJobsDefinition', []) label: 'Type', ngBind: 'queued_job.type_label', link: false, - columnClass: "col-md-2 hidden-sm hidden-xs" + columnClass: "col-md-2 hidden-sm hidden-xs", + searchable: false }, name: { label: 'Name', @@ -76,7 +77,7 @@ angular.module('QueuedJobsDefinition', []) submit: { icon: 'icon-rocket', mode: 'all', - ngClick: 'relaunchJob(queued_job.id)', + ngClick: 'relaunchJob($event, queued_job.id)', awToolTip: 'Relaunch using the same parameters', dataPlacement: 'top' }, diff --git a/awx/ui/static/js/lists/RunningJobs.js b/awx/ui/static/js/lists/RunningJobs.js index 83b7605573..26302bcb25 100644 --- a/awx/ui/static/js/lists/RunningJobs.js +++ b/awx/ui/static/js/lists/RunningJobs.js @@ -54,7 +54,8 @@ angular.module('RunningJobsDefinition', []) label: 'Type', ngBind: 'running_job.type_label', link: false, - columnClass: "col-md-2 hidden-sm hidden-xs" + columnClass: "col-md-2 hidden-sm hidden-xs", + searchable: false }, name: { label: 'Name', @@ -76,7 +77,7 @@ angular.module('RunningJobsDefinition', []) submit: { icon: 'icon-rocket', mode: 'all', - ngClick: 'relaunchJob(running_job.id)', + ngClick: 'relaunchJob($event, running_job.id)', awToolTip: 'Relaunch using the same parameters', dataPlacement: 'top' }, diff --git a/awx/ui/static/js/lists/ScheduledJobs.js b/awx/ui/static/js/lists/ScheduledJobs.js index f7f9684880..a37cf14525 100644 --- a/awx/ui/static/js/lists/ScheduledJobs.js +++ b/awx/ui/static/js/lists/ScheduledJobs.js @@ -23,11 +23,11 @@ angular.module('ScheduledJobsDefinition', []) status: { label: 'Status', columnClass: 'col-md-2 col-sm-2 col-xs-2', - awToolTip: "{{ scheduled_job.status_tip }}", + awToolTip: "{{ schedule.status_tip }}", awTipPlacement: "top", - icon: 'icon-job-{{ scheduled_job.status }}', + icon: 'icon-job-{{ schedule.status }}', iconOnly: true, - ngClick: "toggleSchedule(scheduled_job.id)" + ngClick: "toggleSchedule($event, schedule.id)" }, next_run: { label: 'Next Run', @@ -41,9 +41,9 @@ angular.module('ScheduledJobsDefinition', []) type: { label: 'Type', link: false, - sourceModel: '', - sourceField: '', - columnClass: "col-md-2 hidden-sm hidden-xs" + columnClass: "col-md-2 hidden-sm hidden-xs", + ngBind: 'schedule.type_label', + searchable: false }, name: { label: 'Name', @@ -64,20 +64,20 @@ angular.module('ScheduledJobsDefinition', []) "play": { mode: "all", ngClick: "toggleSchedule($event, schedule.id)", - awToolTip: "{{ scheduled_job.play_tip }}", - dataTipWatch: "scheduled_job.play_tip", - iconClass: "{{ 'fa icon-schedule-enabled-' + scheduled_job.enabled }}", + awToolTip: "{{ schedule.play_tip }}", + dataTipWatch: "schedule.play_tip", + iconClass: "{{ 'fa icon-schedule-enabled-' + schedule.enabled }}", dataPlacement: 'top' }, "edit": { mode: "all", - ngClick: "editSchedule(scheduled_job.id)", + ngClick: "editSchedule(schedule.id)", awToolTip: "Edit the schedule", dataPlacement: "top" }, "delete": { mode: 'all', - ngClick: 'deleteSchedule(scheduled_job.id)', + ngClick: 'deleteSchedule(schedule.id)', awToolTip: 'Delete the schedule', dataPlacement: 'top' } diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 6423eb3a31..669494739a 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -978,6 +978,7 @@ input[type="checkbox"].checkbox-no-label { color: @green; } + .icon-job-active:before, .icon-job-running:before, .icon-job-success:before, .icon-job-successful:before, @@ -985,6 +986,7 @@ input[type="checkbox"].checkbox-no-label { content: "\f111"; } + .icon-job-stopped:before, .icon-job-error:before, .icon-job-failed:before, .icon-job-canceled:before { @@ -998,6 +1000,7 @@ input[type="checkbox"].checkbox-no-label { content: "\f10c"; } + .icon-job-active, .icon-job-running, .icon-job-success, .icon-job-successful { @@ -1013,6 +1016,7 @@ input[type="checkbox"].checkbox-no-label { color: @warning; } + .icon-job-stopped, .icon-job-error, .icon-job-failed, .icon-job-canceled { @@ -1053,9 +1057,9 @@ input[type="checkbox"].checkbox-no-label { .pagination li a { font-size: 12px; } - /*.list-table-container { - min-height: 338px; - }*/ + i[class*="icon-job-"] { + font-size: 12.5px; + } } /* Inventory job status badge */ diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index 17f7905d16..f2c38f1d9a 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -449,7 +449,7 @@ angular.module('GeneratorHelpers', []) options = params.options, base = params.base, field = list.fields[fld], - html = ''; + cap, html = ''; if (field.type !== undefined && field.type === 'DropDown') { html = DropDown(params); @@ -496,15 +496,19 @@ angular.module('GeneratorHelpers', []) // Start the Link if ((field.key || field.link || field.linkTo || field.ngClick || field.ngHref || field.awToolTip || field.awPopOver) && options.mode !== 'lookup' && options.mode !== 'select' && !field.noLink && !field.ngBindHtml) { - html += "