From 18de663c0275216312c6dd26dc390106cb9f62d9 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 26 Jan 2015 19:09:48 -0500 Subject: [PATCH] Initial fix of displaying shell commands and warnings in event detail modals --- awx/ui/static/js/helpers/EventViewer.js | 30 ++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/awx/ui/static/js/helpers/EventViewer.js b/awx/ui/static/js/helpers/EventViewer.js index e316bcd6b3..c980d39b0f 100644 --- a/awx/ui/static/js/helpers/EventViewer.js +++ b/awx/ui/static/js/helpers/EventViewer.js @@ -486,7 +486,7 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo h = ''; if (key !== 'host_id' && key !== 'parent' && key !== 'event' && key !== 'src' && key !== 'md5sum' && key !== 'stdout' && key !== 'traceback' && key !== 'stderr' && key !== 'cmd' && key !=='changed' && key !== "verbose_override" && - key !== 'feature_result') { + key !== 'feature_result' && key !== 'warnings') { if (!EventsViewerForm.fields[key]) { h = parseItem(obj[key], key, key); if (h) { @@ -494,6 +494,34 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo found = true; } } + } else if (key === 'cmd') { + // only show cmd if it's a cmd that was run + if (!EventsViewerForm.fields[key] && obj[key].length > 0) { + // include the label head Shell Command instead of CMD in the modal + var i = 0, + string_cmd = ""; + for (i; i < obj[key].length; i++) { + string_cmd += obj[key][i] + " "; + } + h = parseItem(string_cmd, key, "Shell Command"); + if (h) { + html += h; + found = true; + } + } + } else if (key === 'warnings') { + if (!EventsViewerForm.fields[key] && obj[key].length > 0) { + var i = 0, + string_warnings = ""; + for (i; i < obj[key].length; i++) { + string_warnings += obj[key][i] + " "; + } + h = parseItem(string_warnings, key, "Warnings"); + if (h) { + html += h; + found = true; + } + } } } }