Closed hamann closed 11 years ago
Thanks for the contribution! Works for me.
Currently if you click on "select date", the dates are being reset. Could you restore them so that one could easily tweak the date settings?
Also I would like to stick the from/to settings to the session, so that you can switch between dashboards using the same time interval. Is that something you could include or would you consider this a seperate feature?
That's a good idea! The dates will be stored now into a cookie.
I've seen two issues with this:
I tested this on Safari (will try chrome tomorrow) but for 1) not sure what you mean, otherwise the patch worked good for me.
What falkenbt means is, when you want to change one of the dates, the time will be stripped from the other one. That's odd and I will investigate into this.
About switching dashboards - at the moment the dates are stored, but you have to explicitly click on 'select date' and 'show' again. Would it be sufficient to store the dates in SessionStorage and using the dates automatically when switching between dashboards as long as you are in the same window/tab or click on a new 'reset' button?
Sounds good to me. The cookie storage would probably work for this as well but SessionStorage is indeed more powerful and could maybe be used in the future for other things.
Just a sidenote: I probably won't use the reset button a lot because we already have the links to the default relative times next to the timepicker.
With my last changes switching dashboards with selected dates should work now, but the page gets loaded twice. I don't know how to change this behaviour. Maybe someone with a better JS experience could have a look at it?
This is a nice feature.
I would extend the cookie feature to all the time settings. In that case, we should set the cookie in the controller instead of javascript.
This sounds like a very nice feature. I would especially prefer if the selected time (via the time picker or via the shortcut links) could be saved in the session/in a cookie, as I want to always view my dashboards for the last 4 hours, not the last hour, but I tend to forget clicking on the Last 4 hours button. Thanks for your work!
I moved the cookie handling from javascript in the controller. Simplified the js code a lot and allowes us to store all time settings.
sounds good, I will try to test this but I'm really busy currently.
I have just tested this feature. So far so good, but I suggest redirect to the /category/dashboard/time/from/to url if the cookie is set and no time is selected. Makes sense keep the url in sync with the current visualization.
I sent you a PR fixing conflicts and adding the redirect. Merge it and count with my +1.
Done. Thx, keymon
@keymon still +1? Wanna merge?
Yes, I will do.
Hi,
I've added a timepicker to choose a date range instead of typing the url params manually. I'm not a web developer, so it's possible that it needs a bit refactoring.