mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
using join instead of the for loop
This commit is contained in:
@@ -461,7 +461,7 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseJSON(obj) {
|
function parseJSON(obj) {
|
||||||
var h, html = '', key, keys, found = false, i = 0, string_warnings = "", string_cmd = "";
|
var h, html = '', key, keys, found = false, string_warnings = "", string_cmd = "";
|
||||||
if (typeof obj === "object") {
|
if (typeof obj === "object") {
|
||||||
html += "<table class=\"table eventviewer-status\">\n";
|
html += "<table class=\"table eventviewer-status\">\n";
|
||||||
html += "<tbody>\n";
|
html += "<tbody>\n";
|
||||||
@@ -498,9 +498,7 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
|
|||||||
// only show cmd if it's a cmd that was run
|
// only show cmd if it's a cmd that was run
|
||||||
if (!EventsViewerForm.fields[key] && obj[key].length > 0) {
|
if (!EventsViewerForm.fields[key] && obj[key].length > 0) {
|
||||||
// include the label head Shell Command instead of CMD in the modal
|
// include the label head Shell Command instead of CMD in the modal
|
||||||
for (i = 0; i < obj[key].length; i++) {
|
string_cmd += obj[key].join(" ");
|
||||||
string_cmd += obj[key][i] + " ";
|
|
||||||
}
|
|
||||||
h = parseItem(string_cmd, key, "Shell Command");
|
h = parseItem(string_cmd, key, "Shell Command");
|
||||||
if (h) {
|
if (h) {
|
||||||
html += h;
|
html += h;
|
||||||
@@ -509,9 +507,7 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
|
|||||||
}
|
}
|
||||||
} else if (key === 'warnings') {
|
} else if (key === 'warnings') {
|
||||||
if (!EventsViewerForm.fields[key] && obj[key].length > 0) {
|
if (!EventsViewerForm.fields[key] && obj[key].length > 0) {
|
||||||
for (i = 0; i < obj[key].length; i++) {
|
string_warnings += obj[key].join(" ");
|
||||||
string_warnings += obj[key][i] + " ";
|
|
||||||
}
|
|
||||||
h = parseItem(string_warnings, key, "Warnings");
|
h = parseItem(string_warnings, key, "Warnings");
|
||||||
if (h) {
|
if (h) {
|
||||||
html += h;
|
html += h;
|
||||||
|
|||||||
Reference in New Issue
Block a user