mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 23:37:01 -06:00
add encoding param
This commit is contained in:
parent
0506cfdc1d
commit
ad2a69bff4
@ -24,6 +24,7 @@ func RenderToPng(c *middleware.Context) {
|
||||
OrgId: c.OrgId,
|
||||
Timeout: queryReader.Get("timeout", "60"),
|
||||
Timezone: queryReader.Get("tz", ""),
|
||||
Encoding: queryReader.Get("encoding", ""),
|
||||
}
|
||||
|
||||
pngPath, err := renderer.RenderToPng(renderOpts)
|
||||
|
@ -27,6 +27,7 @@ type RenderOpts struct {
|
||||
Timeout string
|
||||
OrgId int64
|
||||
Timezone string
|
||||
Encoding string
|
||||
}
|
||||
|
||||
var ErrTimeout = errors.New("Timeout error. You can set timeout in seconds with &timeout url parameter")
|
||||
@ -95,6 +96,10 @@ func RenderToPng(params *RenderOpts) (string, error) {
|
||||
"renderKey=" + renderKey,
|
||||
}
|
||||
|
||||
if params.Encoding != "" {
|
||||
cmdArgs = append([]string{fmt.Sprintf("--output-encoding=%s", params.Encoding)}, cmdArgs...)
|
||||
}
|
||||
|
||||
cmd := exec.Command(binPath, cmdArgs...)
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user