added time sync for api

pull/5/head
cubedro 10 years ago
parent 1151bfa9dd
commit da45dfbdf9
  1. 5
      app.js
  2. 1
      src/js/controllers.js

@ -211,7 +211,10 @@ api.on('connection', function(spark) {
spark.on('node-ping', function(data) spark.on('node-ping', function(data)
{ {
spark.emit('node-pong'); spark.emit('node-pong', {
clientTime: data.clientTime,
serverTime: _.now()
});
}); });
spark.on('latency', function(data) spark.on('latency', function(data)

@ -150,6 +150,7 @@ netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr)
break; break;
// TODO: Remove when everybody updates api client to 0.0.12
case "update": case "update":
var index = findIndex({id: data.id}); var index = findIndex({id: data.id});

Loading…
Cancel
Save