mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(rendering): minor fix for server side rendering when using non default http addr setting and non default domain setting, #6813
This commit is contained in:
@@ -35,12 +35,12 @@ func RenderToPng(params *RenderOpts) (string, error) {
|
|||||||
executable = executable + ".exe"
|
executable = executable + ".exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
localAddress := "localhost"
|
localDomain := "localhost"
|
||||||
if setting.HttpAddr != setting.DEFAULT_HTTP_ADDR {
|
if setting.HttpAddr != setting.DEFAULT_HTTP_ADDR {
|
||||||
localAddress = setting.HttpAddr
|
localDomain = setting.HttpAddr
|
||||||
}
|
}
|
||||||
|
|
||||||
url := fmt.Sprintf("%s://%s:%s/%s", setting.Protocol, localAddress, setting.HttpPort, params.Path)
|
url := fmt.Sprintf("%s://%s:%s/%s", setting.Protocol, localDomain, setting.HttpPort, params.Path)
|
||||||
|
|
||||||
binPath, _ := filepath.Abs(filepath.Join(setting.PhantomDir, executable))
|
binPath, _ := filepath.Abs(filepath.Join(setting.PhantomDir, executable))
|
||||||
scriptPath, _ := filepath.Abs(filepath.Join(setting.PhantomDir, "render.js"))
|
scriptPath, _ := filepath.Abs(filepath.Join(setting.PhantomDir, "render.js"))
|
||||||
@@ -57,7 +57,7 @@ func RenderToPng(params *RenderOpts) (string, error) {
|
|||||||
"width=" + params.Width,
|
"width=" + params.Width,
|
||||||
"height=" + params.Height,
|
"height=" + params.Height,
|
||||||
"png=" + pngPath,
|
"png=" + pngPath,
|
||||||
"domain=" + setting.Domain,
|
"domain=" + localDomain,
|
||||||
"renderKey=" + renderKey,
|
"renderKey=" + renderKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
vendor/phantomjs/render.js
vendored
2
vendor/phantomjs/render.js
vendored
@@ -22,7 +22,7 @@
|
|||||||
phantom.addCookie({
|
phantom.addCookie({
|
||||||
'name': 'renderKey',
|
'name': 'renderKey',
|
||||||
'value': params.renderKey,
|
'value': params.renderKey,
|
||||||
'domain': 'localhost',
|
'domain': params.domain,
|
||||||
});
|
});
|
||||||
|
|
||||||
page.viewportSize = {
|
page.viewportSize = {
|
||||||
|
|||||||
Reference in New Issue
Block a user