Get robots UI working

This commit is contained in:
Joseph Schorr 2013-11-22 20:14:44 -05:00
parent 43f2dd80a0
commit 12eb932da1
11 changed files with 309 additions and 143 deletions

View file

@ -422,30 +422,19 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
'html': true
});
$('#copyClipboard').clipboardCopy();
var namespace = $routeParams.namespace;
var name = $routeParams.name;
$scope.permissions = {'team': [], 'user': []};
$scope.isDownloadSupported = function() {
try { return !!new Blob(); } catch(e){}
return false;
$scope.getPrefix = function(name) {
var plus = name.indexOf('+');
return name.substr(0, plus + 1);
};
$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, '.dockercfg');
$scope.getShortenedName = function(name) {
var plus = name.indexOf('+');
return name.substr(plus + 1);
};
$scope.grantRole = function() {
@ -554,9 +543,11 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
});
};
$scope.shownTokenCounter = 0;
$scope.showToken = function(tokenCode) {
$scope.shownToken = $scope.tokens[tokenCode];
$('#tokenmodal').modal({});
$scope.shownTokenCounter++;
};
$scope.askChangeAccess = function(newAccess) {
@ -1103,17 +1094,7 @@ function OrgViewCtrl($rootScope, $scope, Restangular, $routeParams) {
});
};
$scope.createTeamShown = function() {
setTimeout(function() {
$('#create-team-box').focus();
}, 10);
};
$scope.createTeam = function() {
var box = $('#create-team-box');
if (box.hasClass('ng-invalid')) { return; }
var teamname = box[0].value.toLowerCase();
$scope.createTeam = function(teamname) {
if (!teamname) {
return;
}