diff --git a/src/main/java/ru/r2cloud/web/api/observation/ObservationList.java b/src/main/java/ru/r2cloud/web/api/observation/ObservationList.java index c6e556d3..1101a3b2 100644 --- a/src/main/java/ru/r2cloud/web/api/observation/ObservationList.java +++ b/src/main/java/ru/r2cloud/web/api/observation/ObservationList.java @@ -30,6 +30,7 @@ public ModelAndView doGet(IHTTPSession session) { List observations = resultDao.findAll(); Collections.sort(observations, ObservationFullComparator.INSTANCE); JsonArray satellites = new JsonArray(); + long currentTime = System.currentTimeMillis(); for (Observation cur : observations) { JsonObject curObservation = new JsonObject(); curObservation.add("id", cur.getId()); @@ -42,6 +43,9 @@ public ModelAndView doGet(IHTTPSession session) { } curObservation.add("start", cur.getStartTimeMillis()); curObservation.add("end", cur.getEndTimeMillis()); + // properly calculate remaining time on the client side + // client side (browser) and server can have different time + curObservation.add("currentTime", currentTime); curObservation.add("status", cur.getStatus().name()); if (cur.getNumberOfDecodedPackets() != null) { curObservation.add("numberOfDecodedPackets", cur.getNumberOfDecodedPackets());