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
aa9ca688
Commit
aa9ca688
authored
Jan 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tokens small fixes
parent
9feb8a73
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
grafana
+1
-1
pkg/api/api.go
+2
-0
pkg/api/token.go
+3
-3
pkg/models/account.go
+0
-1
No files found.
grafana
@
aaa717aa
Subproject commit
d3cc6e518dfd2ceb26c0e568bc603b4473b11a02
Subproject commit
aaa717aac2c1f5e440d61cbe08e55357b4d2570b
pkg/api/api.go
View file @
aa9ca688
...
@@ -25,6 +25,8 @@ func Register(r *macaron.Macaron) {
...
@@ -25,6 +25,8 @@ func Register(r *macaron.Macaron) {
// authed views
// authed views
r
.
Get
(
"/account/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/account/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/account/datasources/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/account/datasources/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/account/collaborators/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/account/apikeys/"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/admin"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/admin"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/dashboard/*"
,
reqSignedIn
,
Index
)
r
.
Get
(
"/dashboard/*"
,
reqSignedIn
,
Index
)
...
...
pkg/api/token.go
View file @
aa9ca688
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
)
)
func
GetTokens
(
c
*
middleware
.
Context
)
{
func
GetTokens
(
c
*
middleware
.
Context
)
{
query
:=
m
.
GetTokensQuery
{
AccountId
:
c
.
Account
.
Id
}
query
:=
m
.
GetTokensQuery
{
AccountId
:
c
.
User
Account
.
Id
}
err
:=
bus
.
Dispatch
(
&
query
)
err
:=
bus
.
Dispatch
(
&
query
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -47,7 +47,7 @@ func AddToken(c *middleware.Context, cmd m.AddTokenCommand) {
...
@@ -47,7 +47,7 @@ func AddToken(c *middleware.Context, cmd m.AddTokenCommand) {
return
return
}
}
cmd
.
AccountId
=
c
.
Account
.
Id
cmd
.
AccountId
=
c
.
User
Account
.
Id
cmd
.
Token
=
util
.
GetRandomString
(
64
)
cmd
.
Token
=
util
.
GetRandomString
(
64
)
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
...
@@ -71,7 +71,7 @@ func UpdateToken(c *middleware.Context, cmd m.UpdateTokenCommand) {
...
@@ -71,7 +71,7 @@ func UpdateToken(c *middleware.Context, cmd m.UpdateTokenCommand) {
return
return
}
}
cmd
.
AccountId
=
c
.
Account
.
Id
cmd
.
AccountId
=
c
.
User
Account
.
Id
err
:=
bus
.
Dispatch
(
&
cmd
)
err
:=
bus
.
Dispatch
(
&
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/models/account.go
View file @
aa9ca688
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
)
)
// Typed errors
// Typed errors
var
(
var
(
ErrAccountNotFound
=
errors
.
New
(
"Account not found"
)
ErrAccountNotFound
=
errors
.
New
(
"Account not found"
)
)
)
...
...
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