mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
Worked on account update view
This commit is contained in:
@@ -33,6 +33,7 @@ function (angular, _, $, config) {
|
|||||||
text: "Account", href: $scope.getUrl("/account"),
|
text: "Account", href: $scope.getUrl("/account"),
|
||||||
icon: "fa fa-shield",
|
icon: "fa fa-shield",
|
||||||
links: [
|
links: [
|
||||||
|
{ text: 'Info', href: $scope.getUrl("/account"), icon: "fa fa-sitemap" },
|
||||||
{ text: 'Data sources', href: $scope.getUrl("/account/datasources"), icon: "fa fa-sitemap" },
|
{ text: 'Data sources', href: $scope.getUrl("/account/datasources"), icon: "fa fa-sitemap" },
|
||||||
{ text: 'Users', href: $scope.getUrl("/account/users"), icon: "fa fa-users" },
|
{ text: 'Users', href: $scope.getUrl("/account/users"), icon: "fa fa-users" },
|
||||||
{ text: 'API Keys', href: $scope.getUrl("/account/apikeys"), icon: "fa fa-key" },
|
{ text: 'API Keys', href: $scope.getUrl("/account/apikeys"), icon: "fa fa-key" },
|
||||||
@@ -42,6 +43,7 @@ function (angular, _, $, config) {
|
|||||||
text: "Profile", href: $scope.getUrl("/profile"),
|
text: "Profile", href: $scope.getUrl("/profile"),
|
||||||
icon: "fa fa-user",
|
icon: "fa fa-user",
|
||||||
links: [
|
links: [
|
||||||
|
{ text: 'Info', href: $scope.getUrl("/profile"), icon: "fa fa-sitemap" },
|
||||||
{ text: 'Password', href:"", icon: "fa fa-lock" },
|
{ text: 'Password', href:"", icon: "fa fa-lock" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
define([
|
||||||
|
'angular',
|
||||||
|
],
|
||||||
|
function (angular) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var module = angular.module('grafana.controllers');
|
||||||
|
|
||||||
|
module.controller('AccountCtrl', function($scope, $http, backendSrv) {
|
||||||
|
|
||||||
|
$scope.init = function() {
|
||||||
|
$scope.getAccount();
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.getAccount = function() {
|
||||||
|
backendSrv.get('/api/account').then(function(account) {
|
||||||
|
$scope.account = account;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.update = function() {
|
||||||
|
if (!$scope.accountForm.$valid) { return; }
|
||||||
|
backendSrv.put('/api/account', $scope.account).then($scope.getAccount);
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.init();
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -5,14 +5,32 @@
|
|||||||
<div class="dashboard-editor-header">
|
<div class="dashboard-editor-header">
|
||||||
<div class="dashboard-editor-title">
|
<div class="dashboard-editor-title">
|
||||||
<i class="fa fa-shield"></i>
|
<i class="fa fa-shield"></i>
|
||||||
Account info
|
Account information
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dashboard-editor-body">
|
<div class="dashboard-editor-body">
|
||||||
|
<div class="row editor-row">
|
||||||
<h3>TODO</h3>
|
<div class="section">
|
||||||
|
<form name="accountForm">
|
||||||
|
<div>
|
||||||
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item" style="width: 120px">
|
||||||
|
<strong>Account name</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text" required ng-model="account.name" class="input-xlarge tight-form-input last" >
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<button type="submit" class="pull-right btn btn-success" ng-click="update()">Update</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="dashboard-editor-header">
|
<div class="dashboard-editor-header">
|
||||||
<div class="dashboard-editor-title">
|
<div class="dashboard-editor-title">
|
||||||
<i class="fa fa-users"></i>
|
<i class="fa fa-users"></i>
|
||||||
Account users
|
Users
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ define([
|
|||||||
'./account/datasourcesCtrl',
|
'./account/datasourcesCtrl',
|
||||||
'./account/apiKeysCtrl',
|
'./account/apiKeysCtrl',
|
||||||
'./account/importCtrl',
|
'./account/importCtrl',
|
||||||
|
'./account/accountCtrl',
|
||||||
'./admin/adminUsersCtrl',
|
'./admin/adminUsersCtrl',
|
||||||
'./grafanaDatasource/datasource',
|
'./grafanaDatasource/datasource',
|
||||||
], function () {});
|
], function () {});
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
<div class="dashboard-editor-header">
|
<div class="dashboard-editor-header">
|
||||||
<div class="dashboard-editor-title">
|
<div class="dashboard-editor-title">
|
||||||
<i class="fa fa-user"></i>
|
<i class="fa fa-user"></i>
|
||||||
Your info
|
Personal information
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dashboard-editor-body">
|
<div class="dashboard-editor-body">
|
||||||
|
<div class="row">
|
||||||
<form name="userForm">
|
<form name="userForm">
|
||||||
|
<div>
|
||||||
<div class="tight-form">
|
<div class="tight-form">
|
||||||
<ul class="tight-form-list">
|
<ul class="tight-form-list">
|
||||||
<li class="tight-form-item" style="width: 80px">
|
<li class="tight-form-item" style="width: 80px">
|
||||||
@@ -48,12 +48,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<button type="submit" class="btn btn-success" ng-click="update()">Update</button>
|
<button type="submit" class="pull-right btn btn-success" ng-click="update()">Update</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="dashboard-editor-header">
|
<div class="dashboard-editor-header">
|
||||||
@@ -111,5 +113,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<li ng-repeat-end ng-if="item.active">
|
<li ng-repeat-end ng-if="item.active">
|
||||||
<ul class="sidemenu-links">
|
<ul class="sidemenu-links">
|
||||||
<li ng-repeat="link in item.links">
|
<li ng-repeat="link in item.links">
|
||||||
<a href="{{link.href}}" class="sidemenu-link"><i class="fa fa-angle-right"></i>{{link.text}}</a>
|
<a href="{{link.href}}" class="sidemenu-link" ng-class="{active: link.active}"><i class="fa fa-angle-right"></i>{{link.text}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ define([
|
|||||||
})
|
})
|
||||||
.when('/account', {
|
.when('/account', {
|
||||||
templateUrl: 'app/features/account/partials/account.html',
|
templateUrl: 'app/features/account/partials/account.html',
|
||||||
|
controller : 'AccountCtrl',
|
||||||
})
|
})
|
||||||
.when('/account/datasources', {
|
.when('/account/datasources', {
|
||||||
templateUrl: 'app/features/account/partials/datasources.html',
|
templateUrl: 'app/features/account/partials/datasources.html',
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
.pro-sidemenu {
|
.pro-sidemenu {
|
||||||
display: none;
|
display: none;
|
||||||
|
a:focus {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pro-sidemenu-open {
|
.pro-sidemenu-open {
|
||||||
@@ -50,9 +53,14 @@
|
|||||||
display: block;
|
display: block;
|
||||||
padding: 6px 0 6px 30px;
|
padding: 6px 0 6px 30px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
color: @gray;
|
||||||
i {
|
i {
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
&.active {
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidemenu-user {
|
.sidemenu-user {
|
||||||
|
|||||||
Reference in New Issue
Block a user