Further UI updates

This commit is contained in:
Joseph Schorr 2016-04-08 17:48:44 -04:00 committed by Jimmy Zelinskie
parent a4a01e76c0
commit 08017c5111
4 changed files with 20 additions and 19 deletions

View file

@ -102,8 +102,6 @@ def update_service_key(kid, name=None, metadata=None):
except ServiceKey.DoesNotExist:
raise ServiceKeyDoesNotExist
_gc_expired(key.service)
def delete_service_key(kid):
try:

View file

@ -533,7 +533,7 @@ class SuperUserServiceKeyManagement(ApiResource):
}
@verify_not_prod
@nickname('getServiceKeys')
@nickname('listServiceKeys')
@require_scope(scopes.SUPERUSER)
def get(self):
if SuperUserPermission().can():
@ -655,8 +655,6 @@ class SuperUserServiceKey(ApiResource):
except model.service_keys.ServiceKeyDoesNotExist:
abort(404)
user = get_authenticated_user()
key_log_metadata = {
'kid': key.kid,
'service': key.service,

View file

@ -75,7 +75,7 @@
</span>
</span>
<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>
</td>
<td>

View file

@ -51,7 +51,7 @@ angular.module('quay').directive('serviceKeysManager', function () {
var loadServiceKeys = function() {
$scope.options.filter = null;
$scope.now = new Date();
$scope.keysResource = ApiService.getServiceKeysAsResource().get(function(resp) {
$scope.keysResource = ApiService.listServiceKeysAsResource().get(function(resp) {
$scope.keys = resp['keys'];
buildOrderedKeys();
});
@ -91,23 +91,28 @@ angular.module('quay').directive('serviceKeysManager', function () {
return {'className': 'warning', 'icon': 'fa-warning'};
}
return {'className': 'info', 'icon': 'fa-info-circle'};
return {'className': 'info', 'icon': 'fa-check'};
};
$scope.showChangeName = function(key) {
bootbox.prompt('Enter a friendly name for key ' + $scope.getKeyTitle(key), function(value) {
if (value) {
var data = {
'name': value
};
bootbox.prompt({
'size': 'small',
'title': 'Enter a friendly name for key ' + $scope.getKeyTitle(key),
'value': key.name || '',
'callback': function(value) {
if (value != null) {
var data = {
'name': value
};
var params = {
'kid': key.kid
};
var params = {
'kid': key.kid
};
ApiService.updateServiceKey(data, params).then(function(resp) {
loadServiceKeys();
}, ApiService.errorDisplay('Could not update service key'));
ApiService.updateServiceKey(data, params).then(function(resp) {
loadServiceKeys();
}, ApiService.errorDisplay('Could not update service key'));
}
}
});
};