mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
add token to href of downloadable standard out
This commit is contained in:
parent
3b961cf4f2
commit
8908f77fea
@ -359,13 +359,13 @@ export default
|
||||
};
|
||||
}])
|
||||
|
||||
.factory('AddPreFormattedText', [function() {
|
||||
.factory('AddPreFormattedText', ['$rootScope', function($rootScope) {
|
||||
return function(params) {
|
||||
var id = params.id,
|
||||
val = params.val,
|
||||
html = "";
|
||||
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 += '<a ng-href="' + params.jobUrl + 'stdout?format=txt_download&token=' + $rootScope.token + '" 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 class='DownloadStandardOut-pre' ng-non-bindable>" + val + "</pre>\n";
|
||||
} else {
|
||||
html += "<pre ng-non-bindable>" + val + "</pre>\n";
|
||||
|
@ -22,7 +22,7 @@
|
||||
<div class="panel panel-default job-stdout-panel">
|
||||
<div class="panel-heading">
|
||||
<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'">
|
||||
<a href="/api/v1/jobs/{{ job.id }}/stdout?format=txt_download&token={{ token }}" 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>
|
||||
|
@ -160,7 +160,7 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<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>
|
||||
<a ng-href="/api/v1/ad_hoc_commands/{{ job.id }}/stdout?format=txt_download&token={{ token }}" 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 class="panel-body stdout-panel-body">
|
||||
|
Loading…
Reference in New Issue
Block a user