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 #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.
|
| `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,
|
tree,
|
||||||
container,
|
container,
|
||||||
pgBrowser,
|
pgBrowser,
|
||||||
panelType
|
panelType,
|
||||||
|
panelVisible = true
|
||||||
) {
|
) {
|
||||||
let item = !_.isNull(tree)? tree.selected(): null,
|
let item = !_.isNull(tree)? tree.selected(): null,
|
||||||
nodeData, node, treeNodeInfo, preferences, graphPref, dashPref;
|
nodeData, node, treeNodeInfo, preferences, graphPref, dashPref;
|
||||||
@ -52,6 +53,7 @@ export function getPanelView(
|
|||||||
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
|
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
|
||||||
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
|
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
|
||||||
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
|
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
|
||||||
|
panelVisible={panelVisible}
|
||||||
/>
|
/>
|
||||||
</Theme>,
|
</Theme>,
|
||||||
container
|
container
|
||||||
|
@ -797,7 +797,7 @@ export default function Dashboard({
|
|||||||
preferences={preferences}
|
preferences={preferences}
|
||||||
sid={sid}
|
sid={sid}
|
||||||
did={did}
|
did={did}
|
||||||
pageVisible={true}
|
pageVisible={props.panelVisible}
|
||||||
></Graphs>
|
></Graphs>
|
||||||
)}
|
)}
|
||||||
{!_.isUndefined(preferences) && preferences.show_activity && (
|
{!_.isUndefined(preferences) && preferences.show_activity && (
|
||||||
@ -887,6 +887,7 @@ Dashboard.propTypes = {
|
|||||||
row: PropTypes.object,
|
row: PropTypes.object,
|
||||||
serverConnected: PropTypes.bool,
|
serverConnected: PropTypes.bool,
|
||||||
dbConnected: PropTypes.bool,
|
dbConnected: PropTypes.bool,
|
||||||
|
panelVisible: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ChartContainer(props) {
|
export function ChartContainer(props) {
|
||||||
|
@ -179,6 +179,9 @@ export default function Graphs({preferences, sid, did, pageVisible, enablePoll=t
|
|||||||
});
|
});
|
||||||
|
|
||||||
let path = getStatsUrl(sid, did, getFor);
|
let path = getStatsUrl(sid, did, getFor);
|
||||||
|
if (!pageVisible){
|
||||||
|
return;
|
||||||
|
}
|
||||||
axios.get(path)
|
axios.get(path)
|
||||||
.then((resp)=>{
|
.then((resp)=>{
|
||||||
let data = resp.data;
|
let data = resp.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user