Add better messaging around squashed fetching when the user is not a namespace admin
Fixed #147
This commit is contained in:
parent
ee154c37a8
commit
96bcfa84ae
2 changed files with 12 additions and 3 deletions
|
@ -42,7 +42,15 @@
|
||||||
allowed-entities="['robot']"
|
allowed-entities="['robot']"
|
||||||
clear-value="clearCounter"
|
clear-value="clearCounter"
|
||||||
auto-clear="false"
|
auto-clear="false"
|
||||||
current-entity="currentEntity"></div>
|
current-entity="currentEntity"
|
||||||
|
ng-show="currentFormat.has_creds"></div>
|
||||||
|
|
||||||
|
<div class="co-alert co-alert-warning" ng-show="!currentFormat.has_creds"
|
||||||
|
style="margin-top: 4px; margin-bottom: 0px">
|
||||||
|
Fetching a {{ currentFormat.title }} requires a robot account. You must therefore
|
||||||
|
have admin access on namespace <strong>{{ repository.namespace }}</strong> to setup
|
||||||
|
this fetch.
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -24,12 +24,13 @@ angular.module('quay').directive('fetchTagDialog', function () {
|
||||||
var updateFormats = function() {
|
var updateFormats = function() {
|
||||||
$scope.formats = [];
|
$scope.formats = [];
|
||||||
|
|
||||||
if ($scope.repository && UserService.isNamespaceAdmin($scope.repository.namespace)) {
|
if ($scope.repository) {
|
||||||
$scope.formats.push({
|
$scope.formats.push({
|
||||||
'title': 'Squashed Docker Image',
|
'title': 'Squashed Docker Image',
|
||||||
'icon': 'ci-squashed',
|
'icon': 'ci-squashed',
|
||||||
'command': 'curl -L -f {http}://{pull_user}:{pull_password}@{hostname}/c1/squash/{namespace}/{name}/{tag} | docker load',
|
'command': 'curl -L -f {http}://{pull_user}:{pull_password}@{hostname}/c1/squash/{namespace}/{name}/{tag} | docker load',
|
||||||
'require_creds': true
|
'require_creds': true,
|
||||||
|
'has_creds': UserService.isNamespaceAdmin($scope.repository.namespace)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue