mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
});
|
@ -3,7 +3,7 @@
|
||||
<div class="container-fluid">
|
||||
<span class="brand">
|
||||
<a ng-click="toggleProSideMenu()">
|
||||
<img class="logo-icon" src="img/fav32.png" bs-tooltip="'Grafana'" data-placement="bottom"></img>
|
||||
<img class="logo-icon" src="img/fav32.png" bs-tooltip="'Grafana'" data-placement="bottom"></img>
|
||||
</a>
|
||||
<span class="page-title">Account Settings</span>
|
||||
</span>
|
||||
@ -12,40 +12,61 @@
|
||||
</div>
|
||||
|
||||
<div class="dashboard-edit-view">
|
||||
<div class="editor-row">
|
||||
<div class="section">
|
||||
|
||||
<div class="dashboard-editor-header">
|
||||
<div class="dashboard-editor-title">
|
||||
<i class="icon icon-user"></i>
|
||||
Personal information
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-editor-body">
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Name</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
<div class="dashboard-editor-header">
|
||||
<div class="dashboard-editor-title">
|
||||
<i class="icon icon-user"></i>
|
||||
Personal information
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Email</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
<div class="dashboard-editor-body">
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Name</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Email</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Account Name</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="editor-option">
|
||||
<label class="small">Account Name</label>
|
||||
<input type="text" class="input-xxlarge" ng-model='currentAnnotation.name' placeholder="name"></input>
|
||||
<div class="dashboard-editor-footer">
|
||||
<button class="btn btn-success">Update</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section">
|
||||
|
||||
</div>
|
||||
<div class="dashboard-editor-header">
|
||||
<div class="dashboard-editor-title">
|
||||
<i class="icon icon-eye-open"></i>
|
||||
Active account
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-editor-footer">
|
||||
<button class="btn btn-success">Update</button>
|
||||
<table class="grafana-options-table">
|
||||
<tr ng-repeat="account in accounts">
|
||||
<td>{{Name}}<td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -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