mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that dashboard graph API is not called after the panel has been closed. Fixes #7518
This commit is contained in:
parent
6bebce7015
commit
e59471d87d
@ -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.
|
||||
|
@ -273,6 +273,15 @@ define(
|
||||
);
|
||||
}
|
||||
}
|
||||
if (eventName == 'panelClosed' && selectedPanel._type == 'dashboard') {
|
||||
getPanelView(
|
||||
pgBrowser.tree,
|
||||
$container[0],
|
||||
pgBrowser,
|
||||
this._type,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user