diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index 749c451b6d..020b300fff 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -1004,15 +1004,16 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar } }; - scope.hostEventsViewer = function(id, name) { + scope.hostEventsViewer = function(id, name, status) { HostEventsViewer({ scope: scope, id: id, name: name, - url: scope.job.related.job_events + url: scope.job.related.job_events, + job_id: scope.job.id, + status: status }); }; - } JobDetailController.$inject = [ '$location', '$rootScope', '$scope', '$compile', '$routeParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath', diff --git a/awx/ui/static/js/helpers/EventViewer.js b/awx/ui/static/js/helpers/EventViewer.js index 3a36a5c49e..b263f26fec 100644 --- a/awx/ui/static/js/helpers/EventViewer.js +++ b/awx/ui/static/js/helpers/EventViewer.js @@ -7,7 +7,7 @@ 'use strict'; -angular.module('EventViewerHelper', ['ModalDialog', 'Utilities']) +angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'HostEventsViewerHelper']) .factory('EventViewer', ['$compile', 'CreateDialog', 'GetEvent', 'Wait', 'EventAddTable', 'GetBasePath', 'LookUpName', 'Empty', 'EventAddPreFormattedText', function($compile, CreateDialog, GetEvent, Wait, EventAddTable, GetBasePath, LookUpName, Empty, EventAddPreFormattedText) { @@ -93,6 +93,7 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities']) $('#eventviewer-modal-dialog').dialog('close'); scope.$destroy(); }; + }; }]) diff --git a/awx/ui/static/js/helpers/HostEventsViewer.js b/awx/ui/static/js/helpers/HostEventsViewer.js index 4c617c7481..b291cb691b 100644 --- a/awx/ui/static/js/helpers/HostEventsViewer.js +++ b/awx/ui/static/js/helpers/HostEventsViewer.js @@ -9,19 +9,22 @@ 'use strict'; -angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities']) +angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities', 'EventViewerHelper']) - .factory('HostEventsViewer', ['$log', '$compile', 'CreateDialog', 'Wait', 'GetBasePath', 'Empty', 'GetEvents', - function($log, $compile, CreateDialog, Wait, GetBasePath, Empty, GetEvents) { + .factory('HostEventsViewer', ['$log', '$compile', 'CreateDialog', 'Wait', 'GetBasePath', 'Empty', 'GetEvents', 'EventViewer', + function($log, $compile, CreateDialog, Wait, GetBasePath, Empty, GetEvents, EventViewer) { return function(params) { var parent_scope = params.scope, scope = parent_scope.$new(true), + job_id = params.job_id, url = params.url, title = params.title, //optional fixHeight, buildTable; scope.host_events_search_name = params.name; - scope.host_events_search_status = 'all'; + scope.host_events_search_status = (params.status) ? params.status : 'all'; + + $log.debug('job_id: ' + job_id + ' url: ' + url + ' title: ' + title + ' name: ' + name + ' status: ' + status); scope.eventsSearchActive = (scope.host_events_search_name) ? true : false; @@ -29,7 +32,7 @@ angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities']) scope.removeModalReady(); } scope.removeModalReady = scope.$on('ModalReady', function() { - Wait('stop'); + scope.hostViewSearching = false; $('#host-events-modal-dialog').dialog('open'); }); @@ -65,9 +68,9 @@ angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities']) scope.removeRefreshHTML = scope.$on('RefreshHTML', function(e, data) { var elem, html = buildTable(data); $('#host-events').html(html); + scope.hostViewSearching = false; elem = angular.element(document.getElementById('host-events')); $compile(elem)(scope); - Wait('stop'); }); buildTable = function(data) { @@ -99,7 +102,7 @@ angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities']) status = 'changed'; status_text = 'Changed'; } - html += "