mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
Small progress on #2014
This commit is contained in:
parent
bf9e51928d
commit
74bf1f23fb
@ -67,7 +67,7 @@ func Register(r *macaron.Macaron) {
|
||||
// users
|
||||
r.Group("/users", func() {
|
||||
r.Get("/:id", wrap(GetUserById))
|
||||
r.Get("/:id/org", wrap(GetUserOrgList))
|
||||
r.Get("/:id/orgs", wrap(GetUserOrgList))
|
||||
r.Put("/:id", bind(m.UpdateUserCommand{}), wrap(UpdateUser))
|
||||
}, reqGrafanaAdmin)
|
||||
|
||||
|
@ -13,6 +13,7 @@ function (angular) {
|
||||
$scope.init = function() {
|
||||
if ($routeParams.id) {
|
||||
$scope.getUser($routeParams.id);
|
||||
$scope.getUserOrgs($routeParams.id);
|
||||
}
|
||||
};
|
||||
|
||||
@ -49,6 +50,12 @@ function (angular) {
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getUserOrgs = function(id) {
|
||||
backendSrv.get('/api/users/' + id + '/orgs').then(function(orgs) {
|
||||
$scope.orgs = orgs;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function() {
|
||||
if (!$scope.userForm.$valid) { return; }
|
||||
|
||||
|
@ -94,5 +94,21 @@
|
||||
<br>
|
||||
<button type="submit" class="pull-right btn btn-success" ng-click="updatePermissions()">Update</button>
|
||||
|
||||
<h2>
|
||||
Organizations
|
||||
</h2>
|
||||
|
||||
<table class="grafana-options-table">
|
||||
<tr ng-repeat="org in orgs">
|
||||
<td style="width: 98%"><strong>Name: </strong> {{org.name}}</td>
|
||||
<td><strong>Role: </strong> {{org.role}}</td>
|
||||
<td class="nobg max-width-btns">
|
||||
<span class="label label-info" ng-show="org.orgId === user.orgId">
|
||||
Current
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user