-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Enable Client Side Timer for all Queries & JS #6217
Comments
Related feature #3312 |
If it doesn't have a UI, I don't think this should be a widget. A protected setTimeout seems to be the right way to achieve this. |
If it is a widget, we can add multiple timers with different intervals. We can also bind |
If not a widget, should this be a section on the settings page (a section for timers and their properties/binding)? |
@ajinkyakulkarni this could simply be writing a JS function in the editor and marking it onPageLoad as
Then you can do multiple timers, functions, basically whatever the user wants will be possible. But we need to get the JS Editor experience right and enable this safe timeout functionality |
+1 on this, I'm building dashboards to monitor remote plants, this would be helpful to always show fresh data from the API, the user cannot keep clicking on refresh ;) |
@PaoloConte thank for the comment here, This will help us in prioritising the issue |
closing in favour of #3312 |
Reopening this because this issue isn't solved completely by #3312. This issue will enable the timer to run automatically without any user intervention vs. the other issue requires user input. @cokoghenun pointed this out. |
@areyabhishek this issue can be closed once we have all the parts ready. The usage would be to use setInterval in a JS function which is run on page load. |
We thought about this but found it pretty limitting. Incase you want some complex logic to run at a fixed interval, it would not be possible as this feature could only run that single action. Adding it as a function gives it much more flexibility of usage |
Not sure what you mean by "some complex logic". The only logic here is to poll the API right? |
you could have some if statements to decide if you want to poll the api. You could want to capture some data from some widgets or other responses and pass that as params to the api you are polling. Many things can be possible |
Hmm, you're right. My thought initially was, we could have a simple form in the UI for this (because requests I've seen around this are simple get requests), then also add a note or something that if the user wants more control, they could use setInterval/clearInterval |
Can we do both? Exposing it in the API pane will enable discovery. Discovering this function is difficult unless you try it or read the documentation. While it's easy to discover the simple option in the API pane and we can add a tooltip explaining that they can also use a function. |
A user requested this feature on Discord - Usecase below https://discord.com/channels/725602949748752515/760761686549463060/1004025639139037204 |
closing this since we now support |
Summary
Add a new Timer widget to execute triggers on a certain frequency
Motivation
Currently, it is not possible to run triggers (call queries, functions, APIs) on a schedule. A Timer widget would be very handy. It will help users build auto-updating, real-time internal tools. On a timer event, we can trigger JS bindings.
Additional Context
Visual Basic (6 and .Net) had a Timer widget which you can drop on the Canvas/form and then set properties. It was very useful to build timers.
The text was updated successfully, but these errors were encountered: