diff --git a/watcher/static/index.js b/watcher/static/index.js index 2e54462..ce44fc9 100644 --- a/watcher/static/index.js +++ b/watcher/static/index.js @@ -6,8 +6,6 @@ requirejs.config({ waitSeconds: 3 }); - - require(['jquery', 'socket.io'], function(jq, io) { function getDurationString(link_data) { @@ -48,21 +46,17 @@ require(['jquery', 'socket.io'], function(jq, io) { }); function addLink(link_id, link_data) { - let start = new Date(link_data["start"] * 1000); - let datestring = start.getHours() + ":" + start.getMinutes(); - let stop = undefined; - let stopString = undefined; - if (link_data["handoff"]) { - stop = new Date(link_data["handoff"] * 1000); - stopString = stop.getHours() + ":" + stop.getMinutes(); + let stop = "handoff" in link_data; - } + let time = (stop ? "Time: " + getDurationString(link_data) : "Running"); + let icon = (stop ? "check" : "question"); + let style = (stop ? "style=\"color:green\"" : ""); let html = ` `;