diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index 6ede35d875..6a1eeb733b 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -32,8 +32,11 @@ function JobDetailController ($scope, $compile, $routeParams, ClearScope, Breadc scope.hostTableRows = 300; scope.hostSummaryTableRows = 300; scope.searchAllHostsEnabled = true; - scope.liveEventsEnabled = true; - scope.liveEventToggleDisabled = false; + + scope.eventsHelpText = "
Successful
\n" + + "Changed
\n" + + "Unreachable
\n" + + "Failed
\n"; event_socket = Socket({ scope: scope, @@ -265,7 +268,6 @@ function JobDetailController ($scope, $compile, $routeParams, ClearScope, Breadc }); $('#job-summary-container').css({ "width": "41.66666667%", "padding-right": "15px", "z-index": 0 }).show(); } - // Detail table height adjusting. First, put page height back to 'normal'. $('#plays-table-detail').height(150); $('#plays-table-detail').mCustomScrollbar("update"); @@ -283,9 +285,9 @@ function JobDetailController ($scope, $compile, $routeParams, ClearScope, Breadc $('#hosts-table-detail').height(150 + (height / 3)); $('#hosts-table-detail').mCustomScrollbar("update"); } - // Summary table height adjusting. - height = ($('#job-detail-container').height() / 2) - $('#hosts-summary-section .header').outerHeight() - $('#hosts-summary-section .table-header').outerHeight() - + height = ($('#job-detail-container').height() / 2) - $('#hosts-summary-section .header').outerHeight() - + $('#hosts-summary-section .table-header').outerHeight() - $('#summary-search-section').outerHeight() - 20; $('#hosts-summary-table').height(height); $('#hosts-summary-table').mCustomScrollbar("update"); @@ -394,12 +396,13 @@ function JobDetailController ($scope, $compile, $routeParams, ClearScope, Breadc scope.setSearchAll = function(search) { if (search === 'host') { - scope.search_all_label = 'Host name'; + scope.search_all_label = 'Host'; scope.searchAllDisabled = false; scope.search_all_placeholder = 'Search all by host name'; } else { scope.search_all_label = 'Failures'; + scope.search_all_placeholder = 'Show failed events'; scope.searchAllDisabled = true; scope.search_all_placeholder = ''; } diff --git a/awx/ui/static/js/helpers/JobDetail.js b/awx/ui/static/js/helpers/JobDetail.js index 828c688092..50b057011d 100644 --- a/awx/ui/static/js/helpers/JobDetail.js +++ b/awx/ui/static/js/helpers/JobDetail.js @@ -65,6 +65,7 @@ function(UpdatePlayStatus, UpdateHostStatus, UpdatePlayChild, AddHostResult, Sel name: event.play, created: event.created, status: (event.failed) ? 'failed' : (event.changed) ? 'changed' : 'none', + elapsed: '00:00:00', children: [] }); SelectPlay({ @@ -107,6 +108,15 @@ function(UpdatePlayStatus, UpdateHostStatus, UpdatePlayChild, AddHostResult, Sel id: event.id }); } + if (event.event === 'playbook_on_no_hosts_matched') { + UpdatePlayStatus({ + scope: scope, + play_id: event.parent, + failed: true, + changed: false, + modified: event.modified + }); + } if (event.event === 'playbook_on_task_start') { hostCount = GetHostCount({ scope: scope, @@ -714,6 +724,9 @@ function(UpdatePlayStatus, UpdateHostStatus, UpdatePlayChild, AddHostResult, Sel }, 700); // Get current list of hosts from the API + + // is the job done? if so, only select hosts for the last task? + Wait('start'); scope.hostResults = []; url = GetBasePath('jobs') + $routeParams.id + '/job_events/?parent=' + id + '&'; diff --git a/awx/ui/static/less/job-details.less b/awx/ui/static/less/job-details.less index 6a7bd0435b..fff88d56a6 100644 --- a/awx/ui/static/less/job-details.less +++ b/awx/ui/static/less/job-details.less @@ -7,6 +7,11 @@ * */ +@failed-hosts-color: #DA4D49; +@successful-hosts-color: #9ED89E; +@changed-hosts-color: #FFC773; + + #jobs-detail { .nav-path { margin-bottom: 20px; @@ -49,19 +54,31 @@ } .failed-hosts { - background-color: #DA4D49; + background-color: @failed-hosts-color; +} +.failed-hosts-color { + color: @failed-hosts-color; } .successful-hosts { - background-color: #9ED89E; + background-color: @successful-hosts-color; +} +.successful-hosts-color { + color: @successful-hosts-color; } .changed-hosts { - background-color: #FFC773; + background-color: @changed-hosts-color; +} +.changed-hosts-color { + color: @changed-hosts-color; } .skipped-hosts, .no-matching-hosts { background-color: #D4D4D4; } .unreachable-hosts { - background-color: @black; + background-color: @grey; +} +.unreachable-hosts-color { + color: @grey; } .job_well { @@ -73,13 +90,6 @@ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } -#summary-button { - position: absolute; - top: 5px; - right: 20px; - z-index: 100; -} - #hide-summary-button { margin-bottom: 15px; } @@ -204,6 +214,7 @@ float: right; input { width: 250px; + padding-right: 20px; } a { position: absolute; @@ -217,6 +228,17 @@ } } +#search_all_hosts_name { + font-size: 14px; + padding-left: 3px; + padding-right: 20px; +} + +#event-help-link { + margin-left: 3px; + font-size: 14px; +} + #search-all-input-icons { position: absolute; right: 3px; @@ -230,6 +252,10 @@ } } +label.small-label { + font-size: 12px; +} + #task-hosts-section { position: relative; top: 0; @@ -266,6 +292,9 @@ .badge { font-size: 12px; } + .badge-column a { + width: 20%; + } } .mCSB_container { diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index b8774b1244..953451b264 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -740,6 +740,28 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job } }); }; + }]) + + // Toggle switch inspired by http://www.bootply.com/92189 + .directive('awToggleButton', [ function() { + return function(scope, element) { + $(element).click(function() { + $(this).find('.btn').toggleClass('active'); + if ($(this).find('.btn-primary').size()>0) { + $(this).find('.btn').toggleClass('btn-primary'); + } + if ($(this).find('.btn-danger').size()>0) { + $(this).find('.btn').toggleClass('btn-danger'); + } + if ($(this).find('.btn-success').size()>0) { + $(this).find('.btn').toggleClass('btn-success'); + } + if ($(this).find('.btn-info').size()>0) { + $(this).find('.btn').toggleClass('btn-info'); + } + $(this).find('.btn').toggleClass('btn-default'); + }); + }; }]); /* diff --git a/awx/ui/static/partials/job_detail.html b/awx/ui/static/partials/job_detail.html index 5ce66443bd..b258e2e8e1 100644 --- a/awx/ui/static/partials/job_detail.html +++ b/awx/ui/static/partials/job_detail.html @@ -15,13 +15,15 @@