Further UI updates
This commit is contained in:
parent
a4a01e76c0
commit
08017c5111
4 changed files with 20 additions and 19 deletions
|
@ -102,8 +102,6 @@ def update_service_key(kid, name=None, metadata=None):
|
||||||
except ServiceKey.DoesNotExist:
|
except ServiceKey.DoesNotExist:
|
||||||
raise ServiceKeyDoesNotExist
|
raise ServiceKeyDoesNotExist
|
||||||
|
|
||||||
_gc_expired(key.service)
|
|
||||||
|
|
||||||
|
|
||||||
def delete_service_key(kid):
|
def delete_service_key(kid):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -533,7 +533,7 @@ class SuperUserServiceKeyManagement(ApiResource):
|
||||||
}
|
}
|
||||||
|
|
||||||
@verify_not_prod
|
@verify_not_prod
|
||||||
@nickname('getServiceKeys')
|
@nickname('listServiceKeys')
|
||||||
@require_scope(scopes.SUPERUSER)
|
@require_scope(scopes.SUPERUSER)
|
||||||
def get(self):
|
def get(self):
|
||||||
if SuperUserPermission().can():
|
if SuperUserPermission().can():
|
||||||
|
@ -655,8 +655,6 @@ class SuperUserServiceKey(ApiResource):
|
||||||
except model.service_keys.ServiceKeyDoesNotExist:
|
except model.service_keys.ServiceKeyDoesNotExist:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
user = get_authenticated_user()
|
|
||||||
|
|
||||||
key_log_metadata = {
|
key_log_metadata = {
|
||||||
'kid': key.kid,
|
'kid': key.kid,
|
||||||
'service': key.service,
|
'service': key.service,
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="no-expiration" bo-if="!key.expiration_date">
|
<span class="no-expiration" bo-if="!key.expiration_date">
|
||||||
<i class="fa fa-info-circle"></i> Does not expire
|
<i class="fa fa-check"></i> Does not expire
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -51,7 +51,7 @@ angular.module('quay').directive('serviceKeysManager', function () {
|
||||||
var loadServiceKeys = function() {
|
var loadServiceKeys = function() {
|
||||||
$scope.options.filter = null;
|
$scope.options.filter = null;
|
||||||
$scope.now = new Date();
|
$scope.now = new Date();
|
||||||
$scope.keysResource = ApiService.getServiceKeysAsResource().get(function(resp) {
|
$scope.keysResource = ApiService.listServiceKeysAsResource().get(function(resp) {
|
||||||
$scope.keys = resp['keys'];
|
$scope.keys = resp['keys'];
|
||||||
buildOrderedKeys();
|
buildOrderedKeys();
|
||||||
});
|
});
|
||||||
|
@ -91,23 +91,28 @@ angular.module('quay').directive('serviceKeysManager', function () {
|
||||||
return {'className': 'warning', 'icon': 'fa-warning'};
|
return {'className': 'warning', 'icon': 'fa-warning'};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {'className': 'info', 'icon': 'fa-info-circle'};
|
return {'className': 'info', 'icon': 'fa-check'};
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showChangeName = function(key) {
|
$scope.showChangeName = function(key) {
|
||||||
bootbox.prompt('Enter a friendly name for key ' + $scope.getKeyTitle(key), function(value) {
|
bootbox.prompt({
|
||||||
if (value) {
|
'size': 'small',
|
||||||
var data = {
|
'title': 'Enter a friendly name for key ' + $scope.getKeyTitle(key),
|
||||||
'name': value
|
'value': key.name || '',
|
||||||
};
|
'callback': function(value) {
|
||||||
|
if (value != null) {
|
||||||
|
var data = {
|
||||||
|
'name': value
|
||||||
|
};
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
'kid': key.kid
|
'kid': key.kid
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiService.updateServiceKey(data, params).then(function(resp) {
|
ApiService.updateServiceKey(data, params).then(function(resp) {
|
||||||
loadServiceKeys();
|
loadServiceKeys();
|
||||||
}, ApiService.errorDisplay('Could not update service key'));
|
}, ApiService.errorDisplay('Could not update service key'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue