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
e9e2fa29
Commit
e9e2fa29
authored
Feb 23, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started Account -> Organization rename
parent
5b271551
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
56 additions
and
57 deletions
+56
-57
pkg/api/account.go
+3
-3
pkg/api/account_users.go
+3
-3
pkg/api/api.go
+7
-7
src/app/controllers/sidemenuCtrl.js
+2
-2
src/app/features/all.js
+1
-1
src/app/features/org/all.js
+3
-3
src/app/features/org/datasourceEditCtrl.js
+0
-0
src/app/features/org/datasourcesCtrl.js
+0
-0
src/app/features/org/orgApiKeysCtrl.js
+1
-1
src/app/features/org/orgDetailsCtrl.js
+7
-7
src/app/features/org/orgUsersCtrl.js
+4
-4
src/app/features/org/partials/datasourceEdit.html
+0
-0
src/app/features/org/partials/datasources.html
+2
-2
src/app/features/org/partials/orgApiKeys.html
+0
-0
src/app/features/org/partials/orgDetails.html
+5
-5
src/app/features/org/partials/orgUsers.html
+3
-4
src/app/routes/backend/all.js
+15
-15
No files found.
pkg/api/account.go
View file @
e9e2fa29
...
...
@@ -6,7 +6,7 @@ import (
m
"github.com/grafana/grafana/pkg/models"
)
func
Get
Account
(
c
*
middleware
.
Context
)
{
func
Get
Org
(
c
*
middleware
.
Context
)
{
query
:=
m
.
GetAccountByIdQuery
{
Id
:
c
.
AccountId
}
if
err
:=
bus
.
Dispatch
(
&
query
);
err
!=
nil
{
...
...
@@ -27,7 +27,7 @@ func GetAccount(c *middleware.Context) {
c
.
JSON
(
200
,
&
account
)
}
func
Create
Account
(
c
*
middleware
.
Context
,
cmd
m
.
CreateAccountCommand
)
{
func
Create
Org
(
c
*
middleware
.
Context
,
cmd
m
.
CreateAccountCommand
)
{
cmd
.
UserId
=
c
.
UserId
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
...
...
@@ -38,7 +38,7 @@ func CreateAccount(c *middleware.Context, cmd m.CreateAccountCommand) {
c
.
JsonOK
(
"Account created"
)
}
func
Update
Account
(
c
*
middleware
.
Context
,
cmd
m
.
UpdateAccountCommand
)
{
func
Update
Org
(
c
*
middleware
.
Context
,
cmd
m
.
UpdateAccountCommand
)
{
cmd
.
AccountId
=
c
.
AccountId
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
...
...
pkg/api/account_users.go
View file @
e9e2fa29
...
...
@@ -6,7 +6,7 @@ import (
m
"github.com/grafana/grafana/pkg/models"
)
func
Add
Account
User
(
c
*
middleware
.
Context
,
cmd
m
.
AddAccountUserCommand
)
{
func
Add
Org
User
(
c
*
middleware
.
Context
,
cmd
m
.
AddAccountUserCommand
)
{
if
!
cmd
.
Role
.
IsValid
()
{
c
.
JsonApiErr
(
400
,
"Invalid role specified"
,
nil
)
return
...
...
@@ -37,7 +37,7 @@ func AddAccountUser(c *middleware.Context, cmd m.AddAccountUserCommand) {
c
.
JsonOK
(
"User added to account"
)
}
func
Get
Account
Users
(
c
*
middleware
.
Context
)
{
func
Get
Org
Users
(
c
*
middleware
.
Context
)
{
query
:=
m
.
GetAccountUsersQuery
{
AccountId
:
c
.
AccountId
}
if
err
:=
bus
.
Dispatch
(
&
query
);
err
!=
nil
{
...
...
@@ -48,7 +48,7 @@ func GetAccountUsers(c *middleware.Context) {
c
.
JSON
(
200
,
query
.
Result
)
}
func
Remove
Account
User
(
c
*
middleware
.
Context
)
{
func
Remove
Org
User
(
c
*
middleware
.
Context
)
{
userId
:=
c
.
ParamsInt64
(
":id"
)
cmd
:=
m
.
RemoveAccountUserCommand
{
AccountId
:
c
.
AccountId
,
UserId
:
userId
}
...
...
pkg/api/api.go
View file @
e9e2fa29
...
...
@@ -54,13 +54,13 @@ func Register(r *macaron.Macaron) {
})
// account
r
.
Group
(
"/
account
"
,
func
()
{
r
.
Get
(
"/"
,
Get
Account
)
r
.
Post
(
"/"
,
bind
(
m
.
CreateAccountCommand
{}),
Create
Account
)
r
.
Put
(
"/"
,
bind
(
m
.
UpdateAccountCommand
{}),
Update
Account
)
r
.
Post
(
"/users"
,
bind
(
m
.
AddAccountUserCommand
{}),
Add
Account
User
)
r
.
Get
(
"/users"
,
Get
Account
Users
)
r
.
Delete
(
"/users/:id"
,
Remove
Account
User
)
r
.
Group
(
"/
org
"
,
func
()
{
r
.
Get
(
"/"
,
Get
Org
)
r
.
Post
(
"/"
,
bind
(
m
.
CreateAccountCommand
{}),
Create
Org
)
r
.
Put
(
"/"
,
bind
(
m
.
UpdateAccountCommand
{}),
Update
Org
)
r
.
Post
(
"/users"
,
bind
(
m
.
AddAccountUserCommand
{}),
Add
Org
User
)
r
.
Get
(
"/users"
,
Get
Org
Users
)
r
.
Delete
(
"/users/:id"
,
Remove
Org
User
)
},
reqAccountAdmin
)
// auth api keys
...
...
src/app/controllers/sidemenuCtrl.js
View file @
e9e2fa29
...
...
@@ -26,10 +26,10 @@ function (angular, _, $, config) {
$scope
.
menu
.
push
({
text
:
"Data Sources"
,
icon
:
"fa fa-fw fa-database"
,
href
:
$scope
.
getUrl
(
"/
account/
datasources"
),
href
:
$scope
.
getUrl
(
"/datasources"
),
});
$scope
.
menu
.
push
({
text
:
"Organization"
,
href
:
$scope
.
getUrl
(
"/
account
"
),
text
:
"Organization"
,
href
:
$scope
.
getUrl
(
"/
org
"
),
icon
:
"fa fa-fw fa-users"
,
});
}
...
...
src/app/features/all.js
View file @
e9e2fa29
...
...
@@ -10,7 +10,7 @@ define([
'./panel/all'
,
'./profile/profileCtrl'
,
'./profile/changePasswordCtrl'
,
'./
account
/all'
,
'./
org
/all'
,
'./admin/all'
,
'./grafanaDatasource/datasource'
,
],
function
()
{});
src/app/features/
account
/all.js
→
src/app/features/
org
/all.js
View file @
e9e2fa29
define
([
'./accountUsersCtrl'
,
'./datasourcesCtrl'
,
'./datasourceEditCtrl'
,
'./apiKeysCtrl'
,
'./accountCtrl'
,
'./orgUsersCtrl'
,
'./orgApiKeysCtrl'
,
'./orgDetailsCtrl'
,
],
function
()
{});
src/app/features/
account
/datasourceEditCtrl.js
→
src/app/features/
org
/datasourceEditCtrl.js
View file @
e9e2fa29
File moved
src/app/features/
account
/datasourcesCtrl.js
→
src/app/features/
org
/datasourcesCtrl.js
View file @
e9e2fa29
File moved
src/app/features/
account/a
piKeysCtrl.js
→
src/app/features/
org/orgA
piKeysCtrl.js
View file @
e9e2fa29
...
...
@@ -6,7 +6,7 @@ function (angular) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'ApiKeysCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
module
.
controller
(
'
Org
ApiKeysCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
roleTypes
=
[
'Viewer'
,
'Editor'
,
'Admin'
];
$scope
.
token
=
{
role
:
'Viewer'
};
...
...
src/app/features/
account/account
Ctrl.js
→
src/app/features/
org/orgDetails
Ctrl.js
View file @
e9e2fa29
...
...
@@ -6,21 +6,21 @@ function (angular) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'
Account
Ctrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
module
.
controller
(
'
OrgDetails
Ctrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
init
=
function
()
{
$scope
.
get
Account
();
$scope
.
get
OrgInfo
();
};
$scope
.
get
Account
=
function
()
{
backendSrv
.
get
(
'/api/
account
'
).
then
(
function
(
account
)
{
$scope
.
account
=
account
;
$scope
.
get
OrgInfo
=
function
()
{
backendSrv
.
get
(
'/api/
org
'
).
then
(
function
(
account
)
{
$scope
.
org
=
account
;
});
};
$scope
.
update
=
function
()
{
if
(
!
$scope
.
account
Form
.
$valid
)
{
return
;
}
backendSrv
.
put
(
'/api/
account'
,
$scope
.
account
).
then
(
$scope
.
getAccount
);
if
(
!
$scope
.
org
Form
.
$valid
)
{
return
;
}
backendSrv
.
put
(
'/api/
org'
,
$scope
.
org
).
then
(
$scope
.
getOrgInfo
);
};
$scope
.
init
();
...
...
src/app/features/
account/account
UsersCtrl.js
→
src/app/features/
org/org
UsersCtrl.js
View file @
e9e2fa29
...
...
@@ -6,7 +6,7 @@ function (angular) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'
Account
UsersCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
module
.
controller
(
'
Org
UsersCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
user
=
{
loginOrEmail
:
''
,
...
...
@@ -18,18 +18,18 @@ function (angular) {
};
$scope
.
get
=
function
()
{
backendSrv
.
get
(
'/api/
account
/users'
).
then
(
function
(
users
)
{
backendSrv
.
get
(
'/api/
org
/users'
).
then
(
function
(
users
)
{
$scope
.
users
=
users
;
});
};
$scope
.
removeUser
=
function
(
user
)
{
backendSrv
.
delete
(
'/api/
account
/users/'
+
user
.
userId
).
then
(
$scope
.
get
);
backendSrv
.
delete
(
'/api/
org
/users/'
+
user
.
userId
).
then
(
$scope
.
get
);
};
$scope
.
addUser
=
function
()
{
if
(
!
$scope
.
form
.
$valid
)
{
return
;
}
backendSrv
.
post
(
'/api/
account
/users'
,
$scope
.
user
).
then
(
$scope
.
get
);
backendSrv
.
post
(
'/api/
org
/users'
,
$scope
.
user
).
then
(
$scope
.
get
);
};
$scope
.
init
();
...
...
src/app/features/
account
/partials/datasourceEdit.html
→
src/app/features/
org
/partials/datasourceEdit.html
View file @
e9e2fa29
File moved
src/app/features/
account
/partials/datasources.html
→
src/app/features/
org
/partials/datasources.html
View file @
e9e2fa29
<topnav
title=
"Data sources"
icon=
"fa fa-fw fa-database"
subnav=
"true"
>
<ul
class=
"nav"
>
<li
class=
"active"
><a
href=
"
account/
datasources"
>
Overview
</a></li>
<li><a
href=
"
account/
datasources/new"
>
Add new
</a></li>
<li
class=
"active"
><a
href=
"datasources"
>
Overview
</a></li>
<li><a
href=
"datasources/new"
>
Add new
</a></li>
</ul>
</topnav>
...
...
src/app/features/
account/partials/apik
eys.html
→
src/app/features/
org/partials/orgApiK
eys.html
View file @
e9e2fa29
File moved
src/app/features/
account/partials/account
.html
→
src/app/features/
org/partials/orgDetails
.html
View file @
e9e2fa29
<topnav
icon=
"fa fa-fw fa-users"
title=
"Organization"
subnav=
"true"
>
<ul
class=
"nav"
>
<li
class=
"active"
><a
href=
"
account
"
>
Overview
</a></li>
<li><a
href=
"
account
/users"
>
Users
</a></li>
<li
class=
"active"
><a
href=
"
org
"
>
Overview
</a></li>
<li><a
href=
"
org
/users"
>
Users
</a></li>
</ul>
</topnav>
...
...
@@ -15,10 +15,10 @@
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 100px"
>
<strong>
Account n
ame
</strong>
<strong>
N
ame
</strong>
</li>
<li>
<input
type=
"text"
required
ng-model=
"
account
.name"
class=
"input-xxlarge tight-form-input last"
>
<input
type=
"text"
required
ng-model=
"
org
.name"
class=
"input-xxlarge tight-form-input last"
>
</li>
</ul>
<div
class=
"clearfix"
></div>
...
...
@@ -33,7 +33,7 @@
</h2>
<div
ng-controller=
"ApiKeysCtrl"
>
<form
name=
"addTokenrForm"
class=
"form-inline tight-form"
>
<form
name=
"addTokenrForm"
class=
"form-inline tight-form
last
"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 100px"
>
Add a key
...
...
src/app/features/
account/partials/u
sers.html
→
src/app/features/
org/partials/orgU
sers.html
View file @
e9e2fa29
<topnav
title=
"Organization"
icon=
"fa fa-users"
subnav=
"true"
>
<topnav
title=
"Organization"
icon=
"fa fa-
fw fa-
users"
subnav=
"true"
>
<ul
class=
"nav"
>
<li><a
href=
"account"
>
Overview
</a></li>
<li
class=
"active"
><a
href=
"account/users"
>
Users
</a></li>
<li><a
href=
"account/import"
>
Import
</a></li>
<li><a
href=
"org"
>
Overview
</a></li>
<li
class=
"active"
><a
href=
"org/users"
>
Users
</a></li>
</ul>
</topnav>
...
...
src/app/routes/backend/all.js
View file @
e9e2fa29
...
...
@@ -34,28 +34,28 @@ define([
templateUrl
:
'app/features/dashboard/partials/import.html'
,
controller
:
'DashboardImportCtrl'
,
})
.
when
(
'/account'
,
{
templateUrl
:
'app/features/account/partials/account.html'
,
controller
:
'AccountCtrl'
,
})
.
when
(
'/account/datasources'
,
{
templateUrl
:
'app/features/account/partials/datasources.html'
,
.
when
(
'/datasources'
,
{
templateUrl
:
'app/features/org/partials/datasources.html'
,
controller
:
'DataSourcesCtrl'
,
})
.
when
(
'/
account/
datasources/edit/:id'
,
{
templateUrl
:
'app/features/
account
/partials/datasourceEdit.html'
,
.
when
(
'/datasources/edit/:id'
,
{
templateUrl
:
'app/features/
org
/partials/datasourceEdit.html'
,
controller
:
'DataSourceEditCtrl'
,
})
.
when
(
'/
account/
datasources/new'
,
{
templateUrl
:
'app/features/
account
/partials/datasourceEdit.html'
,
.
when
(
'/datasources/new'
,
{
templateUrl
:
'app/features/
org
/partials/datasourceEdit.html'
,
controller
:
'DataSourceEditCtrl'
,
})
.
when
(
'/account/users'
,
{
templateUrl
:
'app/features/account/partials/users.html'
,
controller
:
'AccountUsersCtrl'
,
.
when
(
'/org'
,
{
templateUrl
:
'app/features/org/partials/orgDetails.html'
,
controller
:
'OrgDetailsCtrl'
,
})
.
when
(
'/org/users'
,
{
templateUrl
:
'app/features/org/partials/orgUsers.html'
,
controller
:
'OrgUsersCtrl'
,
})
.
when
(
'/
account
/apikeys'
,
{
templateUrl
:
'app/features/
account/partials/apik
eys.html'
,
.
when
(
'/
org
/apikeys'
,
{
templateUrl
:
'app/features/
org/partials/orgApiK
eys.html'
,
controller
:
'ApiKeysCtrl'
,
})
.
when
(
'/profile'
,
{
...
...
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