mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Merge pull request #355 from jlmitch5/jlm_727_add_dl_stdout
Jlm 727 add dl stdout
This commit is contained in:
@@ -96,9 +96,12 @@ export default
|
|||||||
|
|
||||||
if (data.result_stdout) {
|
if (data.result_stdout) {
|
||||||
$('#logview-tabs li:eq(1)').show();
|
$('#logview-tabs li:eq(1)').show();
|
||||||
|
var showStandardOut = (data.type !== "system_job") ? true : false;
|
||||||
AddPreFormattedText({
|
AddPreFormattedText({
|
||||||
id: 'stdout-form-container',
|
id: 'stdout-form-container',
|
||||||
val: data.result_stdout
|
val: data.result_stdout,
|
||||||
|
standardOut: showStandardOut,
|
||||||
|
jobUrl: data.url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,8 +363,11 @@ export default
|
|||||||
return function(params) {
|
return function(params) {
|
||||||
var id = params.id,
|
var id = params.id,
|
||||||
val = params.val,
|
val = params.val,
|
||||||
html;
|
html = "";
|
||||||
html = "<pre ng-non-bindable>" + val + "</pre>\n";
|
if (params.standardOut) {
|
||||||
|
html += '<a href="' + params.jobUrl + 'stdout?format=txt_download" class="btn btn-primary btn-xs DownloadStandardOut DownloadStandardOut--onModal" id="download-stdout-button" type="button" aw-tool-tip="Download standard out as a .txt file" data-placement="top" ng-show="status === \'cancelled\' || status === \'failed\' || status === \'error\' || status === \'successful\'"><i class="fa fa-download DownloadStandardOut-icon DownloadStandardOut-icon--withText"></i>Download</a>';
|
||||||
|
}
|
||||||
|
html += "<pre ng-non-bindable>" + val + "</pre>\n";
|
||||||
$('#' + id).empty().html(html);
|
$('#' + id).empty().html(html);
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|||||||
@@ -21,7 +21,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="panel panel-default job-stdout-panel">
|
<div class="panel panel-default job-stdout-panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">Standard Output</h3>
|
<h3 class="panel-title">Standard Output
|
||||||
|
<a href="/api/v1/jobs/{{ job.id }}/stdout?format=txt_download" class="btn btn-primary btn-xs DownloadStandardOut DownloadStandardOut--onStandardOutPage" id="download-stdout-button" type="button" aw-tool-tip="Download standard out as a .txt file" data-placement="top" ng-show="job.status === 'cancelled' || job.status === 'failed' || job.status === 'error' || job.status === 'successful'">
|
||||||
|
<i class="fa fa-download DownloadStandardOut-icon DownloadStandardOut-icon--withText"></i>Download
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body stdout-panel-body">
|
<div class="panel-body stdout-panel-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -159,7 +159,9 @@
|
|||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">Standard Output</h3>
|
<h3 class="panel-title">Standard Output
|
||||||
|
<a href="/api/v1/ad_hoc_commands/{{ job.id }}/stdout?format=txt_download" class="btn btn-primary btn-xs DownloadStandardOut DownloadStandardOut--onStandardOutPage" id="download-stdout-button" type="button" aw-tool-tip="Download standard out as a .txt file" data-placement="top" ng-show="job.status === 'cancelled' || job.status === 'failed' || job.status === 'error' || job.status === 'successful'"><i class="fa fa-download DownloadStandardOut-icon DownloadStandardOut-icon--withText"></i>Download</a>
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body stdout-panel-body">
|
<div class="panel-body stdout-panel-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
23
awx/ui/client/src/shared/download-standard-out.block.less
Normal file
23
awx/ui/client/src/shared/download-standard-out.block.less
Normal file
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user