diff --git a/src/app/controllers/pro/accountCtrl.js b/src/app/controllers/pro/accountCtrl.js new file mode 100644 index 00000000000..c77f9aeba92 --- /dev/null +++ b/src/app/controllers/pro/accountCtrl.js @@ -0,0 +1,39 @@ +define([ + 'angular', +], +function (angular) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('AccountCtrl', function($scope, $http, alertSrv) { + + $scope.collaborator = {}; + + $scope.init = function() { + $scope.getAccountInfo(); + }; + + $scope.getAccountInfo = function() { + + }; + + $scope.addCollaborator = function() { + if (!$scope.addCollaboratorForm.$valid) { + return; + } + + $http.post('/api/account/collaborators/add', $scope.collaborator).then(function() { + alertSrv.set('Collaborator added', '', 'success', 3000); + }, function(err) { + if (err.data && err.data.status) { + alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); + } + else if (err.statusText) { + alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); + } + }); + }; + + }); +}); diff --git a/src/app/partials/pro/account.html b/src/app/partials/pro/account.html index 177fd611136..32372a62fcc 100644 --- a/src/app/partials/pro/account.html +++ b/src/app/partials/pro/account.html @@ -3,7 +3,7 @@
+
Account Settings
@@ -12,40 +12,61 @@