diff --git a/awx/ui/client/features/_index.less b/awx/ui/client/features/_index.less index e2339dc9e4..4a69120ed9 100644 --- a/awx/ui/client/features/_index.less +++ b/awx/ui/client/features/_index.less @@ -1,2 +1,3 @@ @import 'credentials/_index'; +@import 'jobs/_index'; @import 'users/tokens/_index'; diff --git a/awx/ui/client/features/jobs/_index.less b/awx/ui/client/features/jobs/_index.less new file mode 100644 index 0000000000..9144f3c93c --- /dev/null +++ b/awx/ui/client/features/jobs/_index.less @@ -0,0 +1,12 @@ +.at-Stdout { + tr { + & > td:first-child { + padding-right: 5px; + border-right: 1px solid gray; + } + + & > td:last-child { + padding-left: 5px; + } + } +} diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js index 358750aefb..71c4bcf408 100644 --- a/awx/ui/client/features/output/index.controller.js +++ b/awx/ui/client/features/output/index.controller.js @@ -1,5 +1,40 @@ -function JobsIndexController (resolved) { - console.log('test', resolved); +import Ansi from 'ansi-to-html'; +import hasAnsi from 'has-ansi'; + +function JobsIndexController (job, $sce) { + const vm = this || {}; + const results = job.get('related.job_events.results'); + const ansi = new Ansi({}); + + /* + * const colors = []; + * + * for (let i = 0; i < 255; i++) { + * colors.push('#ababab'); + * } + * + */ + + let html = ''; + results.forEach((line, i) => { + if (!line.stdout) { + return; + } + + let output; + + if (hasAnsi(line.stdout)) { + output = ansi.toHtml(line.stdout); + } else { + output = line.stdout; // .replace(/(\n|\r)/g, ''); + } + + html += `
right
++