mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
Account stuff
This commit is contained in:
parent
c62ee78cba
commit
32036d017e
39
src/app/controllers/pro/accountCtrl.js
Normal file
39
src/app/controllers/pro/accountCtrl.js
Normal file
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
});
|
@ -12,6 +12,8 @@
|
||||
</div>
|
||||
|
||||
<div class="dashboard-edit-view">
|
||||
<div class="editor-row">
|
||||
<div class="section">
|
||||
|
||||
<div class="dashboard-editor-header">
|
||||
<div class="dashboard-editor-title">
|
||||
@ -47,6 +49,25 @@
|
||||
<div class="dashboard-editor-footer">
|
||||
<button class="btn btn-success">Update</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section">
|
||||
|
||||
<div class="dashboard-editor-header">
|
||||
<div class="dashboard-editor-title">
|
||||
<i class="icon icon-eye-open"></i>
|
||||
Active account
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="grafana-options-table">
|
||||
<tr ng-repeat="account in accounts">
|
||||
<td>{{Name}}<td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-edit-view" style="border-top: solid 1px black;">
|
||||
|
@ -30,7 +30,7 @@
|
||||
</a>
|
||||
<a class="pro-sidemenu-link" href="/account">
|
||||
<i class="icon-user"></i>
|
||||
User accounts
|
||||
Account settings
|
||||
</a>
|
||||
<a class="pro-sidemenu-link" href="/login?logout">
|
||||
<i class="icon-signout"></i>
|
||||
|
@ -1,5 +1,6 @@
|
||||
define([
|
||||
'angular',
|
||||
'controllers/pro/accountCtrl',
|
||||
],
|
||||
function (angular) {
|
||||
"use strict";
|
||||
@ -11,43 +12,11 @@ function (angular) {
|
||||
.when('/admin/datasources', {
|
||||
templateUrl: 'app/partials/pro/admin_datasources.html',
|
||||
controller : 'AdminCtrl',
|
||||
});
|
||||
});
|
||||
|
||||
module.config(function($routeProvider) {
|
||||
$routeProvider
|
||||
})
|
||||
.when('/account', {
|
||||
templateUrl: 'app/partials/pro/account.html',
|
||||
controller : 'AccountCtrl',
|
||||
});
|
||||
});
|
||||
|
||||
module.controller('AdminCtrl', function() {
|
||||
|
||||
});
|
||||
|
||||
module.controller('AccountCtrl', function($scope, $http, alertSrv) {
|
||||
|
||||
$scope.collaborator = {};
|
||||
|
||||
$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);
|
||||
}
|
||||
console.log("value", err);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -65,6 +65,7 @@
|
||||
padding: 12px 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-box-logo {
|
||||
text-align: center;
|
||||
padding-bottom: 50px;
|
||||
|
Loading…
Reference in New Issue
Block a user