mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed png rendering
This commit is contained in:
parent
ed879df1f4
commit
1532eb4278
2
grafana
2
grafana
@ -1 +1 @@
|
||||
Subproject commit 984ece646f831678c5a8f32e4a69f54fdad914c4
|
||||
Subproject commit 64f98d2409152a2bfa34b6f032d21e6bb18b97f8
|
@ -12,7 +12,7 @@ import (
|
||||
func RenderToPng(c *middleware.Context) {
|
||||
accountId := c.UsingAccountId
|
||||
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{
|
||||
Url: c.Params("*") + queryParams,
|
||||
|
@ -1,7 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Unknwon/macaron"
|
||||
@ -22,12 +21,11 @@ func getRequestAccountId(c *Context) int64 {
|
||||
return accountId.(int64)
|
||||
}
|
||||
|
||||
// localhost render query
|
||||
urlQuery := c.Req.URL.Query()
|
||||
if len(urlQuery["render"]) > 0 {
|
||||
accId, _ := strconv.ParseInt(urlQuery["accountId"][0], 10, 64)
|
||||
c.Session.Set("accountId", accId)
|
||||
accountId = accId
|
||||
// TODO: figure out a way to secure this
|
||||
if c.Query("render") == "1" {
|
||||
accountId := c.QueryInt64("accountId")
|
||||
c.Session.Set("accountId", accountId)
|
||||
return accountId
|
||||
}
|
||||
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user