From 071b699ca8a3b1c7dcea5cef9b4fba9143b058ce Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Aug 2015 01:07:32 -0400 Subject: [PATCH 1/5] UI implementation of downloadable standard out --- awx/ui/client/legacy-styles/ansible-ui.less | 22 +++++++++++++++++++ awx/ui/client/src/helpers/LogViewer.js | 11 +++++++--- awx/ui/client/src/partials/job_stdout.html | 3 ++- .../client/src/partials/job_stdout_adhoc.html | 4 +++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 09527af6dc..3c3fb6fd3a 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -2030,3 +2030,25 @@ tr td button i { margin-bottom: 15px; } } + +.DownloadStandardOut { + color: #fff !important; +} + +.DownloadStandardOut--onStandardOutPage { + margin-top: -3px; + margin-right: -9px; + float: right; +} + +.DownloadStandardOut--onModal { + margin-bottom: 10px; +} + +.DownloadStandardOut-icon { + color: #fff; +} + +.DownloadStandardOut-icon--withText { + margin-right: 5px; +} diff --git a/awx/ui/client/src/helpers/LogViewer.js b/awx/ui/client/src/helpers/LogViewer.js index 41aee6384d..ecc07531a3 100644 --- a/awx/ui/client/src/helpers/LogViewer.js +++ b/awx/ui/client/src/helpers/LogViewer.js @@ -98,7 +98,9 @@ export default $('#logview-tabs li:eq(1)').show(); AddPreFormattedText({ id: 'stdout-form-container', - val: data.result_stdout + val: data.result_stdout, + standardOut: true, + jobUrl: data.url }); } @@ -360,8 +362,11 @@ export default return function(params) { var id = params.id, val = params.val, - html; - html = "
" + val + "
\n"; + html = ""; + if (params.standardOut) { + html += 'Download'; + } + html += "
" + val + "
\n"; $('#' + id).empty().html(html); }; }]) diff --git a/awx/ui/client/src/partials/job_stdout.html b/awx/ui/client/src/partials/job_stdout.html index 27fe31db5e..a02a9d8888 100644 --- a/awx/ui/client/src/partials/job_stdout.html +++ b/awx/ui/client/src/partials/job_stdout.html @@ -21,7 +21,8 @@
-

Standard Output

+

Standard Output + Download

diff --git a/awx/ui/client/src/partials/job_stdout_adhoc.html b/awx/ui/client/src/partials/job_stdout_adhoc.html index 8d520c278b..0cddf62af5 100644 --- a/awx/ui/client/src/partials/job_stdout_adhoc.html +++ b/awx/ui/client/src/partials/job_stdout_adhoc.html @@ -159,7 +159,9 @@
-

Standard Output

+

Standard Output + Download +

From b51f8beefbaff76a7dfe71069dbe503ecb492fe2 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Aug 2015 11:49:40 -0400 Subject: [PATCH 2/5] no standard out download for system jobs --- awx/ui/client/src/helpers/LogViewer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/helpers/LogViewer.js b/awx/ui/client/src/helpers/LogViewer.js index ecc07531a3..90d63034e1 100644 --- a/awx/ui/client/src/helpers/LogViewer.js +++ b/awx/ui/client/src/helpers/LogViewer.js @@ -96,10 +96,11 @@ export default if (data.result_stdout) { $('#logview-tabs li:eq(1)').show(); + var showStandardOut = (data.type !== "system_job") ? true : false; AddPreFormattedText({ id: 'stdout-form-container', val: data.result_stdout, - standardOut: true, + standardOut: showStandardOut, jobUrl: data.url }); } From 659fe78285b77052f3e3c0ccb682801db1fedf26 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Aug 2015 11:55:09 -0400 Subject: [PATCH 3/5] fixed downloadable standard out for ad hoc commands --- awx/ui/client/src/partials/job_stdout_adhoc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/partials/job_stdout_adhoc.html b/awx/ui/client/src/partials/job_stdout_adhoc.html index 0cddf62af5..72e3d8dbc4 100644 --- a/awx/ui/client/src/partials/job_stdout_adhoc.html +++ b/awx/ui/client/src/partials/job_stdout_adhoc.html @@ -160,7 +160,7 @@

Standard Output - Download + Download

From 66d71d6d1c58cee538c38a96bc1707dc8c8a0e56 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Aug 2015 12:01:09 -0400 Subject: [PATCH 4/5] moved standard out less block to be more modular --- awx/ui/client/legacy-styles/ansible-ui.less | 22 ------------------ .../shared/download-standard-out.block.less | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 awx/ui/client/src/shared/download-standard-out.block.less diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 3c3fb6fd3a..09527af6dc 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -2030,25 +2030,3 @@ tr td button i { margin-bottom: 15px; } } - -.DownloadStandardOut { - color: #fff !important; -} - -.DownloadStandardOut--onStandardOutPage { - margin-top: -3px; - margin-right: -9px; - float: right; -} - -.DownloadStandardOut--onModal { - margin-bottom: 10px; -} - -.DownloadStandardOut-icon { - color: #fff; -} - -.DownloadStandardOut-icon--withText { - margin-right: 5px; -} diff --git a/awx/ui/client/src/shared/download-standard-out.block.less b/awx/ui/client/src/shared/download-standard-out.block.less new file mode 100644 index 0000000000..984fe1b2e3 --- /dev/null +++ b/awx/ui/client/src/shared/download-standard-out.block.less @@ -0,0 +1,23 @@ +/** @define DownloadStandardOut */ + +.DownloadStandardOut { + color: #fff !important; +} + +.DownloadStandardOut--onStandardOutPage { + margin-top: -3px; + margin-right: -9px; + float: right; +} + +.DownloadStandardOut--onModal { + margin-bottom: 10px; +} + +.DownloadStandardOut-icon { + color: #fff; +} + +.DownloadStandardOut-icon--withText { + margin-right: 5px; +} From 224798351e7ec926d1648d7973bf8ebd4be7e915 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 6 Aug 2015 14:06:48 -0400 Subject: [PATCH 5/5] don't display download button unless job is completed --- awx/ui/client/src/helpers/LogViewer.js | 2 +- awx/ui/client/src/partials/job_stdout.html | 4 +++- awx/ui/client/src/partials/job_stdout_adhoc.html | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/helpers/LogViewer.js b/awx/ui/client/src/helpers/LogViewer.js index 90d63034e1..e098e782dd 100644 --- a/awx/ui/client/src/helpers/LogViewer.js +++ b/awx/ui/client/src/helpers/LogViewer.js @@ -365,7 +365,7 @@ export default val = params.val, html = ""; if (params.standardOut) { - html += 'Download'; + html += 'Download'; } html += "
" + val + "
\n"; $('#' + id).empty().html(html); diff --git a/awx/ui/client/src/partials/job_stdout.html b/awx/ui/client/src/partials/job_stdout.html index a02a9d8888..8c113d908c 100644 --- a/awx/ui/client/src/partials/job_stdout.html +++ b/awx/ui/client/src/partials/job_stdout.html @@ -22,7 +22,9 @@

Standard Output - Download + + Download +

diff --git a/awx/ui/client/src/partials/job_stdout_adhoc.html b/awx/ui/client/src/partials/job_stdout_adhoc.html index 72e3d8dbc4..3dcac4097e 100644 --- a/awx/ui/client/src/partials/job_stdout_adhoc.html +++ b/awx/ui/client/src/partials/job_stdout_adhoc.html @@ -160,7 +160,7 @@

Standard Output - Download + Download