Merge pull request #482 from coreos-inc/builderrview
Fix auto-open of build error command
This commit is contained in:
commit
dac5d54a5e
1 changed files with 8 additions and 9 deletions
|
@ -72,17 +72,16 @@ angular.module('quay').directive('buildLogsView', function () {
|
||||||
// Process the logs we've received.
|
// Process the logs we've received.
|
||||||
$scope.logStartIndex = processLogs(logsData['logs'], logsData['start'], logsData['total']);
|
$scope.logStartIndex = processLogs(logsData['logs'], logsData['start'], logsData['total']);
|
||||||
|
|
||||||
// If the build status is an error, open the last two log entries.
|
// If the build status is an error, automatically open the last command run.
|
||||||
var currentBuild = $scope.currentBuild;
|
var currentBuild = $scope.currentBuild;
|
||||||
if (currentBuild['phase'] == 'error' && $scope.logEntries.length > 1) {
|
if (currentBuild['phase'] == 'error') {
|
||||||
var openLogEntries = function(entry) {
|
for (var i = $scope.logEntries.length - 1; i >= 0; i--) {
|
||||||
if (entry.logs) {
|
var currentEntry = $scope.logEntries[i];
|
||||||
entry.logs.setVisible(true);
|
if (currentEntry['type'] == 'command') {
|
||||||
|
currentEntry['logs'].setVisible(true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
openLogEntries($scope.logEntries[$scope.logEntries.length - 2]);
|
|
||||||
openLogEntries($scope.logEntries[$scope.logEntries.length - 1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the build phase is an error or a complete, then we mark the channel
|
// If the build phase is an error or a complete, then we mark the channel
|
||||||
|
|
Reference in a new issue