Ensure that dashboard graph API is not called after the panel has been closed. Fixes #7518

This commit is contained in:
Pradip Parkale 2022-07-04 12:03:18 +05:30 committed by Akshay Joshi
parent 6bebce7015
commit e59471d87d
5 changed files with 18 additions and 2 deletions

View File

@ -20,4 +20,5 @@ Bug fixes
*********
| `Issue #7517 <https://redmine.postgresql.org/issues/7517>`_ - Enable the start debugging button once execution is completed.
| `Issue #7518 <https://redmine.postgresql.org/issues/7518>`_ - Ensure that dashboard graph API is not called after the panel has been closed.
| `Issue #7523 <https://redmine.postgresql.org/issues/7517>`_ - Fixed typo error for Statistics on the table header.

View File

@ -273,6 +273,15 @@ define(
);
}
}
if (eventName == 'panelClosed' && selectedPanel._type == 'dashboard') {
getPanelView(
pgBrowser.tree,
$container[0],
pgBrowser,
this._type,
false
);
}
}
});

View File

@ -24,7 +24,8 @@ export function getPanelView(
tree,
container,
pgBrowser,
panelType
panelType,
panelVisible = true
) {
let item = !_.isNull(tree)? tree.selected(): null,
nodeData, node, treeNodeInfo, preferences, graphPref, dashPref;
@ -52,6 +53,7 @@ export function getPanelView(
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
panelVisible={panelVisible}
/>
</Theme>,
container

View File

@ -797,7 +797,7 @@ export default function Dashboard({
preferences={preferences}
sid={sid}
did={did}
pageVisible={true}
pageVisible={props.panelVisible}
></Graphs>
)}
{!_.isUndefined(preferences) && preferences.show_activity && (
@ -887,6 +887,7 @@ Dashboard.propTypes = {
row: PropTypes.object,
serverConnected: PropTypes.bool,
dbConnected: PropTypes.bool,
panelVisible: PropTypes.bool,
};
export function ChartContainer(props) {

View File

@ -179,6 +179,9 @@ export default function Graphs({preferences, sid, did, pageVisible, enablePoll=t
});
let path = getStatsUrl(sid, did, getFor);
if (!pageVisible){
return;
}
axios.get(path)
.then((resp)=>{
let data = resp.data;