diff --git a/awx/ui/static/js/helpers/HostEventsViewer.js b/awx/ui/static/js/helpers/HostEventsViewer.js
index 229103acb8..cb734c22dc 100644
--- a/awx/ui/static/js/helpers/HostEventsViewer.js
+++ b/awx/ui/static/js/helpers/HostEventsViewer.js
@@ -35,12 +35,58 @@ angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities'])
scope.removeJobReady();
}
scope.removeEventReady = scope.$on('EventsReady', function(e, data) {
- //var elem;
+ var elem, html;
+
+ //scope.host_events = data.results;
+ //$log.debug(scope.host_events);
scope.host_events = data.results;
-
- //elem = angular.element(document.getElementById('host-events-modal-dialog'));
- //$compile(elem)(scope);
+ scope.host_events_search_name = host_name;
+ scope.host_events_search_status = 'all';
+ scope.host_events = [];
+ html = "
\n";
+ html += "\n";
+ html += "| Status | " +
+ "Play | " +
+ "Task | " +
+ "Result |
\n";
+ html += "\n";
+ html += "\n";
+ data.results.forEach(function(result) {
+ var msg = '',
+ status = 'ok',
+ status_text = 'OK';
+ if (result.event_data.res) {
+ msg = result.event_data.res.msg;
+ }
+ if (result.event === "runner_on_no_hoss") {
+ msg = "No hosts remaining";
+ }
+ if (result.event === 'runner_on_unreachable') {
+ status = 'unreachable';
+ status_text = 'Unreachable';
+ }
+ else if (result.failed) {
+ status = 'failed';
+ status_text = 'Failed';
+ }
+ else if (result.changed) {
+ status = 'changed';
+ status_text = 'Changed';
+ }
+ html += "\n";
+ html += "| " + status_text + " | \n";
+ html += "" + result.play + " | \n";
+ html += "" + result.task + " | \n";
+ html += "" + msg + " | ";
+ html += "
"
+ });
+ html += "\n";
+ html += "
\n";
+ $('#host-events').html(html);
+
+ elem = angular.element(document.getElementById('host-events-modal-dialog'));
+ $compile(elem)(scope);
CreateDialog({
scope: scope,
@@ -50,10 +96,9 @@ angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities'])
callback: 'ModalReady',
id: 'host-events-modal-dialog',
// onResizeStop: resizeText,
- title: ( (title) ? title : 'Event Details' ),
- onOpen: function() {
-
- }
+ title: ( (title) ? title : 'Host Events' )
+ //onOpen: function() {
+ //}
});
});
diff --git a/awx/ui/static/js/lists/HostEvents.js b/awx/ui/static/js/lists/HostEvents.js
new file mode 100644
index 0000000000..7e48630588
--- /dev/null
+++ b/awx/ui/static/js/lists/HostEvents.js
@@ -0,0 +1,82 @@
+/*********************************************
+ * Copyright (c) 2014 AnsibleWorks, Inc.
+ *
+ * HostEvents.js
+ * Host summary event viewer dialog.
+ *
+ */
+
+'use strict';
+
+angular.module('HostEventsListDefinition', [])
+ .value('HostEventList', {
+
+ name: 'host_events',
+ iterator: 'host_event',
+ editTitle: 'Host Events',
+ index: false,
+ hover: true,
+
+ fields: {
+ status: {
+ label: 'Status',
+ columnClass: 'col-md-2',
+
+ },
+ play: {
+ label: 'Play',
+ columnClass: 'col-md-3',
+ key: true,
+ nosort: true,
+ searchable: false,
+ noLink: true
+ },
+ status: {
+ label: 'Status',
+ showValue: false,
+ columnClass: 'col-sm-1 col-xs-2 text-center',
+ searchField: 'failed',
+ searchType: 'boolean',
+ searchOptions: [{
+ name: 'success',
+ value: 0
+ }, {
+ name: 'error',
+ value: 1
+ }],
+ nosort: true,
+ searchable: false,
+ ngClick: 'viewJobEvent(jobevent.id)',
+ awToolTip: '{{ jobevent.statusBadgeToolTip }}',
+ dataPlacement: 'top',
+ badgeIcon: 'fa icon-job-{{ jobevent.status }}',
+ badgePlacement: 'left',
+ badgeToolTip: '{{ jobevent.statusBadgeToolTip }}',
+ badgeTipPlacement: 'top',
+ badgeNgClick: 'viewJobEvent(jobevent.id)'
+ },
+ event_display: {
+ label: 'Event',
+ hasChildren: true,
+ ngClick: 'toggleChildren(jobevent.id, jobevent.related.children)',
+ nosort: true,
+ searchable: false,
+ ngClass: '{{ jobevent.class }}',
+ appendHTML: 'jobevent.event_detail'
+ },
+ host: {
+ label: 'Host',
+ ngBind: 'jobevent.summary_fields.host.name',
+ ngHref: '{{ jobevent.hostLink }}',
+ searchField: 'hosts__name',
+ nosort: true,
+ searchOnly: false,
+ id: 'job-event-host-header',
+ 'class': 'break',
+ columnClass: 'col-lg-2 hidden-sm hidden-xs'
+ }
+ },
+
+ actions: { },
+
+ });
\ No newline at end of file
diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less
index a580fd1121..c2fcef657b 100644
--- a/awx/ui/static/less/ansible-ui.less
+++ b/awx/ui/static/less/ansible-ui.less
@@ -984,6 +984,7 @@ input[type="checkbox"].checkbox-no-label {
.icon-job-successful:before,
.icon-job-changed:before,
.icon-job-ok:before,
+ .icon-job-OK:before,
.icon-job-skipped:before {
content: "\f111";
}
@@ -1008,7 +1009,8 @@ input[type="checkbox"].checkbox-no-label {
.icon-job-running,
.icon-job-success,
.icon-job-successful,
- .icon-job-ok {
+ .icon-job-ok,
+ .icon-job-OK {
color: @green;
}
diff --git a/awx/ui/static/less/job-details.less b/awx/ui/static/less/job-details.less
index c4021619dd..37759861a8 100644
--- a/awx/ui/static/less/job-details.less
+++ b/awx/ui/static/less/job-details.less
@@ -14,6 +14,34 @@
@unreachable-hosts-color: @unreachable;
+#host-events-modal-dialog {
+ #search-form {
+ margin-left: 7px;
+ }
+ #host-events-search-name {
+ width: 200px;
+ }
+ #search-form-input-icons {
+ position: absolute;
+ right: 3px;
+ top: 5px;
+ z-index: 100;
+ a {
+ color: #a9a9a9;
+ }
+ a:hover {
+ color: @black;
+ }
+ }
+ #status-field {
+ margin-left: 15px;
+ }
+
+ table {
+ margin-top: 15px;
+ }
+}
+
#jobs-detail {
.job_summary {
diff --git a/awx/ui/static/partials/job_detail.html b/awx/ui/static/partials/job_detail.html
index 5a67b09c88..00a47bc384 100644
--- a/awx/ui/static/partials/job_detail.html
+++ b/awx/ui/static/partials/job_detail.html
@@ -258,38 +258,36 @@
-