mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where ajax call continues to fire even after disconnect the database server. Fixes #5716
This commit is contained in:
committed by
Akshay Joshi
parent
aac0da4cbc
commit
e494b1520d
@@ -19,7 +19,7 @@ export default class ChartsDOM {
|
||||
this.pageVisible = pageVisible;
|
||||
}
|
||||
|
||||
mount() {
|
||||
render() {
|
||||
if(this.container && this.preferences.show_graphs) {
|
||||
ReactDOM.render(<Graphs sid={this.sid} did={this.did} preferences={this.preferences} pageVisible={this.pageVisible}/>, this.container);
|
||||
}
|
||||
@@ -32,13 +32,13 @@ export default class ChartsDOM {
|
||||
setSidDid(sid, did) {
|
||||
this.sid = sid;
|
||||
this.did = did;
|
||||
this.mount();
|
||||
this.render();
|
||||
}
|
||||
|
||||
reflectPreferences(preferences) {
|
||||
this.preferences = preferences;
|
||||
if(preferences.show_graphs) {
|
||||
this.mount();
|
||||
this.render();
|
||||
} else {
|
||||
this.unmount();
|
||||
}
|
||||
@@ -46,6 +46,6 @@ export default class ChartsDOM {
|
||||
|
||||
setPageVisible(visible) {
|
||||
this.pageVisible = visible;
|
||||
this.mount();
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ define('pgadmin.dashboard', [
|
||||
object_selected: function(item, itemData, node) {
|
||||
let self = this;
|
||||
|
||||
if (dashboardVisible && itemData && itemData._type) {
|
||||
if (itemData && itemData._type) {
|
||||
var treeHierarchy = node.getTreeNodeHierarchy(item),
|
||||
url = NodesDashboard.url(itemData, item, treeHierarchy);
|
||||
|
||||
@@ -378,7 +378,6 @@ define('pgadmin.dashboard', [
|
||||
}
|
||||
} else {
|
||||
this.chartsDomObj && this.chartsDomObj.unmount();
|
||||
$(div).empty();
|
||||
$(div).html(
|
||||
'<div class="pg-panel-message" role="alert">' + gettext('Please connect to the selected server to view the dashboard.') + '</div>'
|
||||
);
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
& .dashboard-graph-body {
|
||||
padding: 0.25rem 0.5rem;
|
||||
height: 175px;
|
||||
height: 165px;
|
||||
|
||||
& .flotr-labels {
|
||||
color: $color-fg !important;
|
||||
|
||||
Reference in New Issue
Block a user