Merge pull request #57 from dirkhh/fixes

Fixes metric
bump for version 0.7.1
Add localization and metric support for map

Until now only energy and stats were translated / converted to support metric
units.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Translate (and better position) start time / end time labels

This looks much nicer - and I had forgotten to translate this in the energy and
stats pages as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly propagate language and metric / imperial settings

Don't forget these settings when changing the date ranges. Similarly, when
visualize.js redirects the client to force a correctly constructed query the
language and metric parameters need to be appended as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix incorrect translation

Used the wrong key string for the translation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Several map fixes

Make sure that the map progress doesn't stall out (especially the progress
slider should behave much more sanely now).

Prevent us from resending the same AJAX request to the server more than once.

Fix the calculation for how much data should be requested from the server via
AJAX (I HATE the type confusion in Javascript... '+' between two variables
behaves in completely braindead ways).

Fix the condition that is used to recognize when we no longer need to get
updates from the server.

Make sure that the asynchronous drawing routine continues to run after we stop
receiving AJAX updates from the server, but that it is no longer called once
everything is drawn.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move conversion functions and string variable into lib.js

This avoids duplication and makes things easier to maintain. It does add a
small amount of overhead but that seems negligible when looking at load times
and processing times.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the conversion functions

It turns out this was not as straight forward as I assumed when implementing
things. Given the massive amount of data that might have to be converted the
lookup and function call overhead made using the more elegant conversion
function way too slow when convering the values in the large arrays. But at
least for these two values there was no difference so I used this "just
because".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improve the hover behavior in stats

With this change the hover function finally notices if we are hovering over a
different series within the same data point - so we now get the correct hover
behavior when moving the mouse over the different bars for the same data point
and most importantly we can get the tooltip to pop up for the average if that
ends up being overlaid ontop of the energy bar (which typically happens in a
weekly chart).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge pull request #58 from dirkhh/variousFixes

Various fixes
Fix another possible null dereference

I fixed the same bug for the daily stats and forgot to add the same check for
the weekly stats. Duh.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable rather simplistic authentication

http only, cleartext passwords, simple array to store users / passwords in the
source code. About as trivial (and easy to intercept) as it gets.

But using https requires a valid certificate and a strong certificate causes
effort and cost for the user... so this is better than nothing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add more information to the welcome screen

As suggested by user Michel U.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show VIN and (most) options in welcome screen as well

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show short number for known firmware builds

This triggers on the major and minor build number and ignores the experimental
version 5.5 and earlier versions that aren't out in the wild anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge pull request #60 from dirkhh/welcomeImprovements

Welcome improvements
version 0.7.2
added 'restla.js' example

restla.js is a simple REST proxy that allows controlling cat through
browser, curl, or REST client, all without exposing Tesla logins and
passwords to the client.
fix for linebreaks