Merge pull request #5424 from jlmitch5/jobResultsFixes

Job results fixes
This commit is contained in:
jlmitch5
2017-02-17 10:51:52 -05:00
committed by GitHub

View File

@@ -298,6 +298,14 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
$scope.job.finished = mungedEvent.finishedTime; $scope.job.finished = mungedEvent.finishedTime;
$scope.jobFinished = true; $scope.jobFinished = true;
$scope.followTooltip = "Jump to last line of standard out."; $scope.followTooltip = "Jump to last line of standard out.";
if ($scope.followEngaged) {
if (!$scope.followScroll) {
$scope.followScroll = function() {
$log.error("follow scroll undefined, standard out directive not loaded yet?");
};
}
$scope.followScroll();
}
} }
if (change === 'countFinished') { if (change === 'countFinished') {
@@ -365,6 +373,10 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
var putAfter; var putAfter;
var isDup = false; var isDup = false;
if ($(".header_" + putIn + ",." + putIn).length === 0) {
appendToBottom(mungedEvent);
} else {
$(".header_" + putIn + ",." + putIn) $(".header_" + putIn + ",." + putIn)
.each((i, v) => { .each((i, v) => {
if (angular.element(v).scope() if (angular.element(v).scope()
@@ -384,6 +396,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
appendToBottom(mungedEvent); appendToBottom(mungedEvent);
} }
}); });
}
if (!isDup) { if (!isDup) {
$(putAfter).after($compile(mungedEvent $(putAfter).after($compile(mungedEvent
@@ -407,17 +420,6 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
// container // container
$(".JobResultsStdOut-followAnchor") $(".JobResultsStdOut-followAnchor")
.appendTo(".JobResultsStdOut-stdoutContainer"); .appendTo(".JobResultsStdOut-stdoutContainer");
// if follow is engaged,
// scroll down to the followAnchor
if ($scope.followEngaged) {
if (!$scope.followScroll) {
$scope.followScroll = function() {
$log.error("follow scroll undefined, standard out directive not loaded yet?");
};
}
$scope.followScroll();
}
} }
}); });
@@ -586,10 +588,25 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
var buffer = []; var buffer = [];
var processBuffer = function() { var processBuffer = function() {
for (let i = 0; i < 20; i++) { var follow = function() {
// if follow is engaged,
// scroll down to the followAnchor
if ($scope.followEngaged) {
if (!$scope.followScroll) {
$scope.followScroll = function() {
$log.error("follow scroll undefined, standard out directive not loaded yet?");
};
}
$scope.followScroll();
}
};
for (let i = 0; i < 4; i++) {
processEvent(buffer[i]); processEvent(buffer[i]);
buffer.splice(i, 1); buffer.splice(i, 1);
} }
follow();
}; };
var bufferInterval; var bufferInterval;