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
1532eb42
Commit
1532eb42
authored
Jan 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed png rendering
parent
ed879df1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
grafana
+1
-1
pkg/api/render.go
+1
-1
pkg/middleware/auth.go
+5
-7
No files found.
grafana
@
64f98d24
Subproject commit
984ece646f831678c5a8f32e4a69f54fdad914c4
Subproject commit
64f98d2409152a2bfa34b6f032d21e6bb18b97f8
pkg/api/render.go
View file @
1532eb42
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
func
RenderToPng
(
c
*
middleware
.
Context
)
{
func
RenderToPng
(
c
*
middleware
.
Context
)
{
accountId
:=
c
.
UsingAccountId
accountId
:=
c
.
UsingAccountId
queryReader
:=
util
.
NewUrlQueryReader
(
c
.
Req
.
URL
)
queryReader
:=
util
.
NewUrlQueryReader
(
c
.
Req
.
URL
)
queryParams
:=
"?render&accountId="
+
strconv
.
FormatInt
(
accountId
,
10
)
+
"&"
+
c
.
Req
.
URL
.
RawQuery
queryParams
:=
"?render
=1
&accountId="
+
strconv
.
FormatInt
(
accountId
,
10
)
+
"&"
+
c
.
Req
.
URL
.
RawQuery
renderOpts
:=
&
renderer
.
RenderOpts
{
renderOpts
:=
&
renderer
.
RenderOpts
{
Url
:
c
.
Params
(
"*"
)
+
queryParams
,
Url
:
c
.
Params
(
"*"
)
+
queryParams
,
...
...
pkg/middleware/auth.go
View file @
1532eb42
package
middleware
package
middleware
import
(
import
(
"strconv"
"strings"
"strings"
"github.com/Unknwon/macaron"
"github.com/Unknwon/macaron"
...
@@ -22,12 +21,11 @@ func getRequestAccountId(c *Context) int64 {
...
@@ -22,12 +21,11 @@ func getRequestAccountId(c *Context) int64 {
return
accountId
.
(
int64
)
return
accountId
.
(
int64
)
}
}
// localhost render query
// TODO: figure out a way to secure this
urlQuery
:=
c
.
Req
.
URL
.
Query
()
if
c
.
Query
(
"render"
)
==
"1"
{
if
len
(
urlQuery
[
"render"
])
>
0
{
accountId
:=
c
.
QueryInt64
(
"accountId"
)
accId
,
_
:=
strconv
.
ParseInt
(
urlQuery
[
"accountId"
][
0
],
10
,
64
)
c
.
Session
.
Set
(
"accountId"
,
accountId
)
c
.
Session
.
Set
(
"accountId"
,
accId
)
return
accountId
accountId
=
accId
}
}
return
0
return
0
...
...
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