mirror of
https://github.com/ansible/awx.git
synced 2026-01-29 23:34:42 -03:30
commit
ba2ff026b3
@ -44,6 +44,9 @@
|
|||||||
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany"
|
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany"
|
||||||
ng-show="tooManyPastEvents">Too much previous output to display. Showing running standard output.</div>
|
ng-show="tooManyPastEvents">Too much previous output to display. Showing running standard output.</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- next is 1 is a hack to get the first line to be put in the pane in the
|
||||||
|
right place -->
|
||||||
|
<div class="next_is_1"></div>
|
||||||
<div id="followAnchor"
|
<div id="followAnchor"
|
||||||
class="JobResultsStdOut-followAnchor">
|
class="JobResultsStdOut-followAnchor">
|
||||||
<div class="JobResultsStdOut-toTop"
|
<div class="JobResultsStdOut-toTop"
|
||||||
|
|||||||
@ -297,94 +297,35 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(change === 'stdout'){
|
if(change === 'stdout'){
|
||||||
// put stdout elements in stdout container
|
if (!$scope.events[mungedEvent.counter]) {
|
||||||
|
// line hasn't been put in the pane yet
|
||||||
|
|
||||||
|
// create new child scope
|
||||||
|
$scope.events[mungedEvent.counter] = $scope.$new();
|
||||||
|
$scope.events[mungedEvent.counter]
|
||||||
|
.event = mungedEvent;
|
||||||
|
|
||||||
var appendToBottom = function(mungedEvent){
|
// let's see if we have a specific place to put it in
|
||||||
// if we get here then the event type was either a
|
// the pane
|
||||||
// header line, recap line, or one of the additional
|
let $prevElem = $(`.next_is_${mungedEvent.start_line}`);
|
||||||
// event types, so we append it to the bottom.
|
if ($prevElem && $prevElem.length) {
|
||||||
// These are the event types for captured
|
// if so, put it there
|
||||||
// stdout not directly related to playbook or runner
|
$(`.next_is_${mungedEvent.start_line}`)
|
||||||
// events:
|
.after($compile(mungedEvent
|
||||||
// (0, 'debug', _('Debug'), False),
|
.stdout)($scope.events[mungedEvent
|
||||||
// (0, 'verbose', _('Verbose'), False),
|
.counter]));
|
||||||
// (0, 'deprecated', _('Deprecated'), False),
|
} else {
|
||||||
// (0, 'warning', _('Warning'), False),
|
// if not, put it at the bottom
|
||||||
// (0, 'system_warning', _('System Warning'), False),
|
angular
|
||||||
// (0, 'error', _('Error'), True),
|
|
||||||
angular
|
|
||||||
.element(".JobResultsStdOut-stdoutContainer")
|
.element(".JobResultsStdOut-stdoutContainer")
|
||||||
.append($compile(mungedEvent
|
.append($compile(mungedEvent
|
||||||
.stdout)($scope.events[mungedEvent
|
.stdout)($scope.events[mungedEvent
|
||||||
.counter]));
|
.counter]));
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// this scopes the event to that particular
|
|
||||||
// block of stdout.
|
|
||||||
// If you need to see the event a particular
|
|
||||||
// stdout block is from, you can:
|
|
||||||
// angular.element($0).scope().event
|
|
||||||
$scope.events[mungedEvent.counter] = $scope.$new();
|
|
||||||
$scope.events[mungedEvent.counter]
|
|
||||||
.event = mungedEvent;
|
|
||||||
|
|
||||||
if (mungedEvent.stdout.indexOf("not_skeleton") > -1) {
|
|
||||||
// put non-duplicate lines into the standard
|
|
||||||
// out pane where they should go (within the
|
|
||||||
// right header section, before the next line
|
|
||||||
// as indicated by start_line)
|
|
||||||
window.$ = $;
|
|
||||||
var putIn;
|
|
||||||
var classList = $("div",
|
|
||||||
"<div>"+mungedEvent.stdout+"</div>")
|
|
||||||
.attr("class").split(" ");
|
|
||||||
if (classList
|
|
||||||
.filter(v => v.indexOf("task_") > -1)
|
|
||||||
.length) {
|
|
||||||
putIn = classList
|
|
||||||
.filter(v => v.indexOf("task_") > -1)[0];
|
|
||||||
} else if(classList
|
|
||||||
.filter(v => v.indexOf("play_") > -1)
|
|
||||||
.length) {
|
|
||||||
putIn = classList
|
|
||||||
.filter(v => v.indexOf("play_") > -1)[0];
|
|
||||||
} else {
|
|
||||||
appendToBottom(mungedEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var putAfter;
|
// delete ref to the elem because it might leak scope
|
||||||
var isDup = false;
|
// if you don't
|
||||||
$(".header_" + putIn + ",." + putIn)
|
$prevElem = null;
|
||||||
.each((i, v) => {
|
|
||||||
if (angular.element(v).scope()
|
|
||||||
.event.start_line < mungedEvent
|
|
||||||
.start_line) {
|
|
||||||
putAfter = v;
|
|
||||||
} else if (angular.element(v).scope()
|
|
||||||
.event.start_line === mungedEvent
|
|
||||||
.start_line) {
|
|
||||||
isDup = true;
|
|
||||||
return false;
|
|
||||||
} else if (angular.element(v).scope()
|
|
||||||
.event.start_line > mungedEvent
|
|
||||||
.start_line) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!isDup) {
|
|
||||||
$(putAfter).after($compile(mungedEvent
|
|
||||||
.stdout)($scope.events[mungedEvent
|
|
||||||
.counter]));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
classList = null;
|
|
||||||
putIn = null;
|
|
||||||
} else {
|
|
||||||
appendToBottom(mungedEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// move the followAnchor to the bottom of the
|
// move the followAnchor to the bottom of the
|
||||||
@ -453,7 +394,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.stdoutContainerAvailable.promise.then(() => {
|
$scope.stdoutContainerAvailable.promise.then(() => {
|
||||||
getSkeleton(jobData.related.job_events + "?order_by=id&or__event__in=playbook_on_start,playbook_on_play_start,playbook_on_task_start,playbook_on_stats");
|
getSkeleton(jobData.related.job_events + "?order_by=start_line&or__event__in=playbook_on_start,playbook_on_play_start,playbook_on_task_start,playbook_on_stats");
|
||||||
});
|
});
|
||||||
|
|
||||||
var getEvents;
|
var getEvents;
|
||||||
|
|||||||
@ -78,6 +78,12 @@ export default ['$log', 'moment', function($log, moment){
|
|||||||
// .JobResultsStdOut-aLineOfStdOut element
|
// .JobResultsStdOut-aLineOfStdOut element
|
||||||
getLineClasses: function(event, line, lineNum) {
|
getLineClasses: function(event, line, lineNum) {
|
||||||
var string = "";
|
var string = "";
|
||||||
|
|
||||||
|
if (lineNum === event.end_line) {
|
||||||
|
// used to tell you where to put stuff in the pane
|
||||||
|
string += ` next_is_${event.end_line + 1}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.event_name === "playbook_on_play_start") {
|
if (event.event_name === "playbook_on_play_start") {
|
||||||
// play header classes
|
// play header classes
|
||||||
string += " header_play";
|
string += " header_play";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user