mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #13352 from amuraru/patch-2
Updated phantomjs render script to take full height screenshots
This commit is contained in:
commit
29f1c9259a
@ -50,18 +50,21 @@
|
|||||||
|
|
||||||
function checkIsReady() {
|
function checkIsReady() {
|
||||||
var panelsRendered = page.evaluate(function() {
|
var panelsRendered = page.evaluate(function() {
|
||||||
var panelCount = document.querySelectorAll('.panel').length;
|
var panelCount = document.querySelectorAll('plugin-component').length;
|
||||||
return window.panelsRendered >= panelCount;
|
return window.panelsRendered >= panelCount;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (panelsRendered || totalWaitMs > timeoutMs) {
|
if (panelsRendered || totalWaitMs > timeoutMs) {
|
||||||
var bb = page.evaluate(function () {
|
var bb = page.evaluate(function () {
|
||||||
return document.getElementsByClassName("main-view")[0].getBoundingClientRect();
|
var container = document.getElementsByClassName("dashboard-container")
|
||||||
|
if (container.length == 0) {
|
||||||
|
container = document.getElementsByClassName("panel-container")
|
||||||
|
}
|
||||||
|
return container[0].getBoundingClientRect();
|
||||||
});
|
});
|
||||||
|
|
||||||
page.clipRect = {
|
// reset viewport to render full page
|
||||||
top: bb.top,
|
page.viewportSize = {
|
||||||
left: bb.left,
|
|
||||||
width: bb.width,
|
width: bb.width,
|
||||||
height: bb.height
|
height: bb.height
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user