parent
972e4be811
commit
08d7b4babe
23 changed files with 1290 additions and 630 deletions
|
@ -19,10 +19,9 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
|
||||
$scope.robots = null;
|
||||
$scope.loading = false;
|
||||
$scope.shownRobot = null;
|
||||
$scope.showRobotCounter = 0;
|
||||
$scope.Config = Config;
|
||||
$scope.feedback = null;
|
||||
$scope.robotDisplayInfo = null;
|
||||
|
||||
// Listen for route changes and update the tabs accordingly.
|
||||
var locationListener = $rootScope.$on('$routeUpdate', function(){
|
||||
|
@ -66,23 +65,10 @@ angular.module('quay').directive('robotsManager', function () {
|
|||
}
|
||||
};
|
||||
|
||||
$scope.regenerateToken = function(username) {
|
||||
if (!username) { return; }
|
||||
|
||||
var shortName = $scope.getShortenedName(username);
|
||||
ApiService.regenerateRobotToken($scope.organization, null, {'robot_shortname': shortName}).then(function(updated) {
|
||||
var index = $scope.findRobotIndexByName(username);
|
||||
if (index >= 0) {
|
||||
$scope.robots.splice(index, 1);
|
||||
$scope.robots.push(updated);
|
||||
}
|
||||
$scope.shownRobot = updated;
|
||||
}, ApiService.errorDisplay('Cannot regenerate robot account token'));
|
||||
};
|
||||
|
||||
$scope.showRobot = function(info) {
|
||||
$scope.shownRobot = info;
|
||||
$scope.showRobotCounter++;
|
||||
$scope.robotDisplayInfo = {
|
||||
'name': info.name
|
||||
};
|
||||
};
|
||||
|
||||
$scope.findRobotIndexByName = function(name) {
|
||||
|
|
Reference in a new issue