-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Describe the bug
When we select a time range to view get some data, e.g. metrics in the Prometheus plugin, we are adding the time
, timeEnd
and timeStart
parameter to the URL. When we then copy this URL and open it a day later, it will still use the selected time range, but in the options dialog it shows Last 15 Minutes
.
To Reproduce
- Open the Prometheus plugin
- Run a query and copy the URL
- Wait some minutes and refresh the browser page
- It still shows
Last 15 Minutes
but uses the time range from some minutes ago
Expected behavior
When the URL is opened, it should use the formerly selected time range, but it should show the custom
time range instead of Last 15 Minutes
.
Additional context
At the moment we have to pass the time
parameter within the URL so that we can refresh the page. It would be better to not set the time
parameter and instead change it directly in the state.
This must be done in nearly all plugins, so that we should create a general function in the core
plugin to parse the search location which can be used across plugins. Then we can pass the time
as additional parameter to this function and use it directly, so that we do not have to add it to the URL.
When a user then opens a plugin, we can decide on the provided parameter what we want to do:
- If the
timeEnd
andtimeStart
parameters are present, we use them to set a custom time range. - If only the
time
parameter is present we, use it to set the time range, but where the timeStart is the current time and not a old one.