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

@ -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'));
}
}
});
};