mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 17:06:57 -06:00
feat(rendering): fixed issue with png rendering, recently introduced by profiler refactoring
This commit is contained in:
parent
5c35fac8fe
commit
23aa614baf
@ -99,7 +99,9 @@ export class Profiler {
|
||||
}
|
||||
|
||||
renderingCompleted(panelId, panelTimings) {
|
||||
this.panelsRendered++;
|
||||
// add render counter to root scope
|
||||
// used by phantomjs render.js to know when panel has rendered
|
||||
this.$rootScope.panelsRendered = this.panelsRendered++;
|
||||
|
||||
if (this.enabled) {
|
||||
panelTimings.renderEnd = new Date().getTime();
|
||||
|
8
vendor/phantomjs/render.js
vendored
8
vendor/phantomjs/render.js
vendored
@ -36,7 +36,7 @@
|
||||
// console.log('Loading a web page: ' + params.url + ' status: ' + status);
|
||||
|
||||
function checkIsReady() {
|
||||
var canvas = page.evaluate(function() {
|
||||
var panelsRendered = page.evaluate(function() {
|
||||
if (!window.angular) { return false; }
|
||||
var body = window.angular.element(document.body);
|
||||
if (!body.injector) { return false; }
|
||||
@ -44,12 +44,10 @@
|
||||
|
||||
var rootScope = body.injector().get('$rootScope');
|
||||
if (!rootScope) {return false;}
|
||||
if (!rootScope.performance) { return false; }
|
||||
var panelsToLoad = window.angular.element('div.panel').length;
|
||||
return rootScope.performance.panelsRendered >= panelsToLoad;
|
||||
return rootScope.panelsRendered;
|
||||
});
|
||||
|
||||
if (canvas || tries === 1000) {
|
||||
if (panelsRendered || tries === 1000) {
|
||||
var bb = page.evaluate(function () {
|
||||
return document.getElementsByClassName("main-view")[0].getBoundingClientRect();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user