aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-data.js
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-28 16:42:32 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-28 16:42:32 +0200
commite5323ecaf854924cdc6226a5db716d35ae347e9b (patch)
tree91962661cd90886a8ffd7cd8b1debf50c8e77042 /web/js/nms-data.js
parent6fbb4fcf563a4cbdd11932e415bd50d7d6279e3b (diff)
Fix numerous time-travel issues in front and API
Fixes #69 #11 #5 Introduces nmsTime which unifies the time travel code a bit. It still needs some work, but this is much better. All conversion is now done by native JavaScript methods, freeing us from the hell that is parsing it ourself. One thing should be added: The backend should discard any now=values that are not 5-minute intervals. We don't want to kill the cache and the database by extension. Still need to re-implement the "replay event" shorthand, but that ties in to #54
Diffstat (limited to 'web/js/nms-data.js')
-rw-r--r--web/js/nms-data.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web/js/nms-data.js b/web/js/nms-data.js
index 14e5fed..e3c4106 100644
--- a/web/js/nms-data.js
+++ b/web/js/nms-data.js
@@ -231,7 +231,8 @@ nmsData._genericUpdater = function(name, cacheok) {
dataType: "json",
success: function (data, textStatus, jqXHR) {
if (nmsData[name] == undefined || nmsData[name]['hash'] != data['hash']) {
- nmsData._last = data['time'];
+ if (name == "ping")
+ nmsData._last = data['time'];
nmsData.old[name] = nmsData[name];
nmsData[name] = data;
nmsMap.drawNow();