Better error display for build logs view

Fixes #1492
This commit is contained in:
Joseph Schorr 2016-05-31 14:41:45 -04:00
parent af58989046
commit 303db01ec5
3 changed files with 14 additions and 3 deletions

View file

@ -6,7 +6,7 @@
box-shadow: inset 10px 10px 5px -9px rgba(0,0,0,0.75);
background-color: #263945;
min-height: 100px;
min-height: 74px;
}
.build-logs-view .co-alert {

View file

@ -24,12 +24,17 @@
please check for JavaScript or networking issues and contact support.
</div>
<div class="co-alert co-alert-danger" ng-if="loadError == 'unauthorized'">
You are not authorized to view builds logs. Please have the owner of the repository grant you
admin access to this repository.
</div>
<div ng-show="!loadError && pollChannel.skipping">
Refreshing Build Status...
<span class="cor-loader"></span>
</div>
<div ng-show="!pollChannel.skipping">
<div ng-show="!loadError && !pollChannel.skipping">
<span class="no-logs" ng-if="!logEntries.length && currentBuild.phase == 'waiting'">
(Waiting for build to start)
</span>

View file

@ -132,10 +132,16 @@ angular.module('quay').directive('buildLogsView', function () {
}
handleLogsData(resp, callback);
}, function() {
}, function(resp) {
if (resp.status == 403) {
$scope.loadError = 'unauthorized';
} else {
$scope.loadError = 'request-failed';
}
callback(false);
});
}, function() {
$scope.loadError = 'request-failed';
callback(false);
});
};