|
@@ -9,20 +9,12 @@ function (angular) {
|
|
|
module.controller('AccountCtrl', function($scope, $http, backendSrv) {
|
|
module.controller('AccountCtrl', function($scope, $http, backendSrv) {
|
|
|
|
|
|
|
|
$scope.collaborator = {};
|
|
$scope.collaborator = {};
|
|
|
- $scope.token = {
|
|
|
|
|
- role: "ReadWrite"
|
|
|
|
|
- };
|
|
|
|
|
- $scope.roleTypes = [
|
|
|
|
|
- "ReadWrite",
|
|
|
|
|
- "Read"
|
|
|
|
|
- ];
|
|
|
|
|
- $scope.showTokens = false;
|
|
|
|
|
|
|
+ $scope.showTokens = false;
|
|
|
|
|
|
|
|
$scope.init = function() {
|
|
$scope.init = function() {
|
|
|
$scope.getAccount();
|
|
$scope.getAccount();
|
|
|
$scope.getOtherAccounts();
|
|
$scope.getOtherAccounts();
|
|
|
- $scope.getTokens();
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$scope.getAccount = function() {
|
|
$scope.getAccount = function() {
|
|
@@ -45,25 +37,6 @@ function (angular) {
|
|
|
}).then($scope.getOtherAccounts);
|
|
}).then($scope.getOtherAccounts);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- $scope.getTokens = function() {
|
|
|
|
|
- backendSrv.get('/api/tokens').then(function(tokens) {
|
|
|
|
|
- $scope.tokens = tokens;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $scope.removeToken = function(id) {
|
|
|
|
|
- backendSrv.delete('/api/tokens/'+id).then($scope.getTokens);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $scope.addToken = function() {
|
|
|
|
|
- backendSrv.request({
|
|
|
|
|
- method: 'PUT',
|
|
|
|
|
- url: '/api/tokens',
|
|
|
|
|
- data: $scope.token,
|
|
|
|
|
- desc: 'Add token'
|
|
|
|
|
- }).then($scope.getTokens);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$scope.update = function() {
|
|
$scope.update = function() {
|
|
|
if (!$scope.accountForm.$valid) { return; }
|
|
if (!$scope.accountForm.$valid) { return; }
|
|
|
|
|
|