mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 23:36:48 -06:00
Fixed Statistics panel hang issue for 1000+ tables. Fixes #3664
This commit is contained in:
parent
2afa3d8267
commit
6244463ac1
@ -18,6 +18,7 @@ Bug fixes
|
|||||||
| `Bug #3475 <https://redmine.postgresql.org/issues/3475>`_ - Fixed execution time to show Hours part for long running queries in Query Tool.
|
| `Bug #3475 <https://redmine.postgresql.org/issues/3475>`_ - Fixed execution time to show Hours part for long running queries in Query Tool.
|
||||||
| `Bug #3608 <https://redmine.postgresql.org/issues/3608>`_ - Messages tab of query tool should be clear on subsequent execution of table/view using View/Edit Data.
|
| `Bug #3608 <https://redmine.postgresql.org/issues/3608>`_ - Messages tab of query tool should be clear on subsequent execution of table/view using View/Edit Data.
|
||||||
| `Bug #3609 <https://redmine.postgresql.org/issues/3609>`_ - Clear drop-down menu should be disabled for View/Edit Data.
|
| `Bug #3609 <https://redmine.postgresql.org/issues/3609>`_ - Clear drop-down menu should be disabled for View/Edit Data.
|
||||||
|
| `Bug #3664 <https://redmine.postgresql.org/issues/3664>`_ - Fixed Statistics panel hang issue for 1000+ tables.
|
||||||
| `Bug #3693 <https://redmine.postgresql.org/issues/3693>`_ - Proper error should be thrown when server group is created with existing name.
|
| `Bug #3693 <https://redmine.postgresql.org/issues/3693>`_ - Proper error should be thrown when server group is created with existing name.
|
||||||
| `Bug #3695 <https://redmine.postgresql.org/issues/3695>`_ - Ensure long string should be wrap in alertify dialogs.
|
| `Bug #3695 <https://redmine.postgresql.org/issues/3695>`_ - Ensure long string should be wrap in alertify dialogs.
|
||||||
| `Bug #3697 <https://redmine.postgresql.org/issues/3697>`_ - Ensure that output of the query should be displayed even if Data Output window is detached from the Query Tool.
|
| `Bug #3697 <https://redmine.postgresql.org/issues/3697>`_ - Ensure that output of the query should be displayed even if Data Output window is detached from the Query Tool.
|
||||||
|
@ -188,7 +188,7 @@ define([
|
|||||||
'remove': function() {
|
'remove': function() {
|
||||||
if (this.grid) {
|
if (this.grid) {
|
||||||
if (this.grid.collection) {
|
if (this.grid.collection) {
|
||||||
this.grid.collection.reset(null, {silent: true});
|
this.grid.collection.reset({silent: true});
|
||||||
delete (this.grid.collection);
|
delete (this.grid.collection);
|
||||||
}
|
}
|
||||||
delete (this.grid);
|
delete (this.grid);
|
||||||
|
@ -117,7 +117,7 @@ define('misc.statistics', [
|
|||||||
_.bindAll(
|
_.bindAll(
|
||||||
this,
|
this,
|
||||||
'showStatistics', 'panelVisibilityChanged',
|
'showStatistics', 'panelVisibilityChanged',
|
||||||
'__createMultiLineStatistics', '__createSingleLineStatistics');
|
'__createMultiLineStatistics', '__createSingleLineStatistics', '__loadMoreRows');
|
||||||
|
|
||||||
_.extend(
|
_.extend(
|
||||||
this, {
|
this, {
|
||||||
@ -253,10 +253,22 @@ define('misc.statistics', [
|
|||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
$msgContainer.text('');
|
$msgContainer.text('');
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
var data = res.data;
|
var data = self.data = res.data;
|
||||||
if (node.hasCollectiveStatistics || data['rows'].length > 1) {
|
if (node.hasCollectiveStatistics || data['rows'].length > 1) {
|
||||||
|
// Listen scroll event to load more rows
|
||||||
|
pgBrowser.Events.on(
|
||||||
|
'pgadmin-browser:panel-statistics:' +
|
||||||
|
wcDocker.EVENT.SCROLLED,
|
||||||
|
self.__loadMoreRows
|
||||||
|
);
|
||||||
self.__createMultiLineStatistics.call(self, data, node.statsPrettifyFields);
|
self.__createMultiLineStatistics.call(self, data, node.statsPrettifyFields);
|
||||||
} else {
|
} else {
|
||||||
|
// Do not listen the scroll event
|
||||||
|
pgBrowser.Events.off(
|
||||||
|
'pgadmin-browser:panel-statistics:' +
|
||||||
|
wcDocker.EVENT.SCROLLED,
|
||||||
|
self.__loadMoreRows
|
||||||
|
);
|
||||||
self.__createSingleLineStatistics.call(self, data, node.statsPrettifyFields);
|
self.__createSingleLineStatistics.call(self, data, node.statsPrettifyFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +398,17 @@ define('misc.statistics', [
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.collection.reset(rows);
|
this.collection.reset(rows.splice(0, 50));
|
||||||
|
},
|
||||||
|
|
||||||
|
__loadMoreRows: function() {
|
||||||
|
let elem = $('.pg-panel-statistics-container').closest('.wcFrameCenter')[0];
|
||||||
|
if ((elem.scrollHeight - 10) < elem.scrollTop + elem.offsetHeight) {
|
||||||
|
var rows = this.data['rows'];
|
||||||
|
if (rows.length > 0) {
|
||||||
|
this.collection.add(rows.splice(0, 50));
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
__createSingleLineStatistics: function(data, prettifyFields) {
|
__createSingleLineStatistics: function(data, prettifyFields) {
|
||||||
|
Loading…
Reference in New Issue
Block a user