Expose team in AllianceStation JSON for field monitor (fixes #32).

This commit is contained in:
Patrick Fairbank
2016-10-16 15:18:22 -07:00
parent 067b53d347
commit 33844049ed
8 changed files with 51 additions and 45 deletions

View File

@@ -10,9 +10,14 @@ var websocket;
var handleStatus = function(data) {
// Update the team status view.
$.each(data.AllianceStations, function(station, stationStatus) {
if (stationStatus.Team) {
$("#status" + station + " .team").text(stationStatus.Team.Id);
} else {
$("#status" + station + " .team").text("");
}
if (stationStatus.DsConn) {
var dsConn = stationStatus.DsConn;
$("#status" + station + " .team").text(stationStatus.DsConn.TeamId);
$("#status" + station + " .ds-status").attr("data-status-ok", dsConn.DsLinked);
$("#status" + station + " .ds-status").text(dsConn.MBpsToRobot.toFixed(1) + "/" + dsConn.MBpsFromRobot.toFixed(1));
$("#status" + station + " .robot-status").attr("data-status-ok", dsConn.RobotLinked);