Add a "Download dockercfg" link to the token view
This commit is contained in:
parent
d51ab5952b
commit
08c365be28
6 changed files with 438 additions and 0 deletions
|
@ -498,6 +498,25 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
|
|||
});
|
||||
});
|
||||
|
||||
$scope.isDownloadSupported = function() {
|
||||
try { return !!new Blob(); } catch(e){}
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.downloadCfg = function(token) {
|
||||
var auth = $.base64.encode("$token:" + token.code);
|
||||
config = {
|
||||
"https://quay.io/v1/": {
|
||||
"auth": auth,
|
||||
"email": ""
|
||||
}
|
||||
};
|
||||
|
||||
var file = JSON.stringify(config, null, ' ');
|
||||
var blob = new Blob([file]);
|
||||
saveAs(blob, token.friendlyName + "-dockercfg");
|
||||
};
|
||||
|
||||
$scope.addNewPermission = function(username) {
|
||||
// Don't allow duplicates.
|
||||
if ($scope.permissions[username]) { return; }
|
||||
|
|
Reference in a new issue