mocdaniel / dashing-icinga2

Dashing dashboard for Icinga 2 using the REST API
MIT License
204 stars 47 forks source link

Changing timezone #92

Closed benhartwich closed 5 years ago

benhartwich commented 5 years ago

Hi,

how can I change the date / timezone of the dashlet? It seems that UTC is used by default although my server and icinga has the right timezone set.

dnsmichi commented 5 years ago

Edit this line: https://github.com/dnsmichi/dashing-icinga2/blob/master/dashboards/icinga2.erb#L17

benhartwich commented 5 years ago

Thanks, what´s the best practise when using docker environment?

dnsmichi commented 5 years ago

Rebuild the image and run it. Likewise, push it to your own registry. That applies for any changes made to the source code btw, also re-arranging dashlets.

benhartwich commented 5 years ago

Thanks. Hmm, I think an environment variable would be perfect - if it´s somehow possible. Or using the system´s date. It would be a little bit complicated staying updateable when I rebuild this image for my own, wouldn´t it?

dnsmichi commented 5 years ago

Sure, I just did not have time to look into a solution here. Likely you can create a similar one like #54 - feel free to create PR.

dnsmichi commented 5 years ago

You can test the linked PR.

michi@mbpmif ~/dev/github/dashing-icinga2 (feature/clock-timezone-config=) $ DASHBOARD_TIMEZONE="Europe/Berlin" binpaths/ruby/2.6.0/bin/smashing start -p 8005

Screen Shot 2019-10-23 at 10 17 56

benhartwich commented 5 years ago

Thank you very much - so the new environment variable will be DASHBOARD_TIMEZONE? Have I to build the docker manually or can I use docker pull?

dnsmichi commented 5 years ago

That's not in Docker atm, that's just a patch for the source code to try.