isaozler / grafana-shift-selector

The shift selector allows you to adjust the time range of your grafana dashboard to one specific shift or a range of shifts.
Apache License 2.0
6 stars 6 forks source link

Add an option to allow change "to" param to 'now' instead of the end time of a shift #22

Open hungnt61h opened 9 months ago

hungnt61h commented 9 months ago

There is a problem that when I enabled the Real-time shift auto-select option, the "to" parameter on url was sought to the end time of a shift. That was not really helpful while I was querying PromQL that calculated a sum of data point in a time range like from the start time of the shift till now. To solve this problem, I have modified your code to add a new option like below.

image

So my query is able to calculate the sum of data points from the start time of a shift till present. image image

I hope you would approve this feature and guide me how to contribute my work to your plugin. By the way, I would suggest another feature that is adding a shift countdown. It would appear below the shift selector on the same panel.