Refresh the dashboard from the react panel plugin

There is any way to refresh dashboard from react panel plugin?

Hi! Could you share some more details on your use case? Why do you want to refresh the dashboard?

Hi.

I develop my custom plugin in which we can send some value to the influx database. After pressing the send button, I would like the other plugins that display data from the database to be refreshed and show the current value.

Hm. I donā€™t believe think this is supported. My gut feeling tells me that full dashboard refresh is probably not something we expose to plugins, as it could potentially lead to poor experience. If this is something youā€™d still like to see, Iā€™d recommend that you submit an enhancement request.

Ok, thanks for help.

Did some research, and it seems like this was possible in Angular plugins by emitting a refresh event, but I donā€™t see the event emitter being exposed to React plugins. Iā€™ll continue digging, and will update this topic once I know more.

4 Likes

Looks like event handling is still being worked on for React plugins:

2 Likes

I think I need some help. I donā€™t quite know how to use Event Bus in my component. The ā€œ@ grafana / dataā€ module has no exported member similar to EventBus or EventBusSrv.

Iā€™ve have accomplished this using
<a href="#" onclick="document.getElementsByClassName('btn btn--radius-right-0 navbar-button navbar-button--border-right-0')[0].click()">
inside a panel. Simple javascript that clicks the refresh button. Since this is possible, Iā€™d think it would be worthwhile exposing as a better option.

Any news on this topic?

2 Likes

Hello @marcus, do we have any update on this feature?

Hello, is there any news ?

I know that the ā€œData manipulationā€ plugin from @mikhailvolkov , accomplishes this using locationService.reload(), I implemented a refresh condition using that plugin and if you just want to refresh the dashboard it does the job, I had a small issue because the Grafana variables in the template were not being ā€œclearedā€, they kept their last value instead of refreshing the query but I had a workaround using locationService.replace(currentPath), and refreshing again.

I hope it helps.

1 Like

In my case I use RunQuery() in the QueryEditor. it refresh the dashboard without reloading the page.

@nicolasdossantos248 RunQuery only reloads the specific panel the query is in, not all the dashboard.