Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
74bf1f23
Commit
74bf1f23
authored
May 19, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small progress on #2014
parent
bf9e5192
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
+24
-1
pkg/api/api.go
+1
-1
public/app/features/admin/adminEditUserCtrl.js
+7
-0
public/app/features/admin/partials/edit_user.html
+16
-0
No files found.
pkg/api/api.go
View file @
74bf1f23
...
...
@@ -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/org
s
"
,
wrap
(
GetUserOrgList
))
r
.
Put
(
"/:id"
,
bind
(
m
.
UpdateUserCommand
{}),
wrap
(
UpdateUser
))
},
reqGrafanaAdmin
)
...
...
public/app/features/admin/adminEditUserCtrl.js
View file @
74bf1f23
...
...
@@ -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
;
}
...
...
public/app/features/admin/partials/edit_user.html
View file @
74bf1f23
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment