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
6115941d
Commit
6115941d
authored
Feb 17, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
middleware: rename org-id -> orgId
parent
5174d050
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
pkg/middleware/org_redirect.go
+1
-1
pkg/middleware/org_redirect_test.go
+2
-2
pkg/services/alerting/eval_context.go
+1
-1
No files found.
pkg/middleware/org_redirect.go
View file @
6115941d
...
...
@@ -11,7 +11,7 @@ import (
func
OrgRedirect
()
macaron
.
Handler
{
return
func
(
res
http
.
ResponseWriter
,
req
*
http
.
Request
,
c
*
macaron
.
Context
)
{
orgId
:=
c
.
QueryInt64
(
"org
-i
d"
)
orgId
:=
c
.
QueryInt64
(
"org
I
d"
)
if
orgId
==
0
{
return
}
...
...
pkg/middleware/org_redirect_test.go
View file @
6115941d
...
...
@@ -28,7 +28,7 @@ func TestOrgRedirectMiddleware(t *testing.T) {
})
sc
.
m
.
Get
(
"/"
,
sc
.
defaultHandler
)
sc
.
fakeReq
(
"GET"
,
"/?org
-i
d=3"
)
.
exec
()
sc
.
fakeReq
(
"GET"
,
"/?org
I
d=3"
)
.
exec
()
Convey
(
"change org and redirect"
,
func
()
{
So
(
sc
.
resp
.
Code
,
ShouldEqual
,
302
)
...
...
@@ -50,7 +50,7 @@ func TestOrgRedirectMiddleware(t *testing.T) {
})
sc
.
m
.
Get
(
"/"
,
sc
.
defaultHandler
)
sc
.
fakeReq
(
"GET"
,
"/?org
-i
d=3"
)
.
exec
()
sc
.
fakeReq
(
"GET"
,
"/?org
I
d=3"
)
.
exec
()
Convey
(
"not allowed to change org"
,
func
()
{
So
(
sc
.
resp
.
Code
,
ShouldEqual
,
404
)
...
...
pkg/services/alerting/eval_context.go
View file @
6115941d
...
...
@@ -113,7 +113,7 @@ func (c *EvalContext) GetRuleUrl() (string, error) {
if
slug
,
err
:=
c
.
GetDashboardSlug
();
err
!=
nil
{
return
""
,
err
}
else
{
ruleUrl
:=
fmt
.
Sprintf
(
"%sdashboard/db/%s?fullscreen&edit&tab=alert&panelId=%d&org
-i
d=%d"
,
setting
.
AppUrl
,
slug
,
c
.
Rule
.
PanelId
,
c
.
Rule
.
OrgId
)
ruleUrl
:=
fmt
.
Sprintf
(
"%sdashboard/db/%s?fullscreen&edit&tab=alert&panelId=%d&org
I
d=%d"
,
setting
.
AppUrl
,
slug
,
c
.
Rule
.
PanelId
,
c
.
Rule
.
OrgId
)
return
ruleUrl
,
nil
}
}
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