mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Prevent shared queries from being unnecessarily re-run (#77490)
* Dashboards: Prevent shared queries from being unnecessarily re-run * Minor change * Set solo panel as being viewed --------- Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
@@ -71,7 +71,10 @@ export function runSharedRequest(options: QueryRunnerOptions, query: DashboardQu
|
||||
|
||||
// If we are in fullscreen the other panel will not execute any queries
|
||||
// So we have to trigger it from here
|
||||
if (!listenToPanel.isInView) {
|
||||
if (
|
||||
(!listenToPanel.isInView && listenToPanel.refreshWhenInView) ||
|
||||
dashboard?.otherPanelInFullscreen(listenToPanel)
|
||||
) {
|
||||
const { datasource, targets } = listenToPanel;
|
||||
const modified = {
|
||||
...options,
|
||||
@@ -79,6 +82,8 @@ export function runSharedRequest(options: QueryRunnerOptions, query: DashboardQu
|
||||
panelId: listenToPanelId,
|
||||
queries: targets,
|
||||
};
|
||||
|
||||
listenToPanel.refreshWhenInView = false;
|
||||
listenToRunner.run(modified);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user