I have a custom javascript panel which loads and prints an RSS feed.
I’d like to have it refresh at regular intervals.
Currently I’m using a simple setInterval to refresh every few minutes.
I’d prefer to synchronize to the refresh rate of the dashboard instead.
It seems to me there is probably some sort of global event triggered on every refresh that my script should be able to listen to using jQuery.
Is there such an event my script can listen to?
Thanks! I guess that only works for proper plug-ins, and not for small Javascript bits in the Text/HTML panel? Ah well, might be wise to just go ahead with a full plug-in anyway.
angular.element('grafana-app').injector().get('timeSrv').$rootScope
is undefined on Grafana 6.2.5
Instead, this now works: angular.element('grafana-app').injector().get('$rootScope').$on('refresh', doSomething);