Have the last log entries open in the Dockerfile build view when an error occurred
This commit is contained in:
parent
724fec1b74
commit
a518a7ed3e
1 changed files with 13 additions and 0 deletions
|
@ -1094,6 +1094,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
||||||
// Note: We use extend here rather than replacing as Angular is depending on the
|
// Note: We use extend here rather than replacing as Angular is depending on the
|
||||||
// root build object to remain the same object.
|
// root build object to remain the same object.
|
||||||
$.extend(true, $scope.builds[$scope.currentBuildIndex], resp);
|
$.extend(true, $scope.builds[$scope.currentBuildIndex], resp);
|
||||||
|
var currentBuild = $scope.builds[$scope.currentBuildIndex];
|
||||||
checkPollTimer();
|
checkPollTimer();
|
||||||
|
|
||||||
// Load the updated logs for the build.
|
// Load the updated logs for the build.
|
||||||
|
@ -1110,6 +1111,18 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
||||||
processLogs(resp['logs'], resp['start']);
|
processLogs(resp['logs'], resp['start']);
|
||||||
$scope.logStartIndex = resp['total'];
|
$scope.logStartIndex = resp['total'];
|
||||||
$scope.polling = false;
|
$scope.polling = false;
|
||||||
|
|
||||||
|
// If the build status is an error, open the last two log entries.
|
||||||
|
if (currentBuild['phase'] == 'error' && $scope.logEntries.length > 1) {
|
||||||
|
var openLogEntries = function(entry) {
|
||||||
|
if (entry.logs) {
|
||||||
|
entry.logs.setVisible(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
openLogEntries($scope.logEntries[$scope.logEntries.length - 2]);
|
||||||
|
openLogEntries($scope.logEntries[$scope.logEntries.length - 1]);
|
||||||
|
}
|
||||||
}, function() {
|
}, function() {
|
||||||
$scope.polling = false;
|
$scope.polling = false;
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue