diff --git a/python/smap/data/index.html b/python/smap/data/index.html index 540948c..f7f8530 100644 --- a/python/smap/data/index.html +++ b/python/smap/data/index.html @@ -54,9 +54,15 @@ }); function latest(r) { + if (!r.length) { + return undefined; + } return r.slice(-1)[0][1]; } function latestts(r) { + if (!r.length) { + return undefined; + } return r.slice(-1)[0][0]; } function resetUpdater() { @@ -174,8 +180,8 @@ function makeTimeseries(path, meta) { console.log(meta); if (meta['Actuator'] === undefined) { - return latest(meta["Readings"]) + - meta ["Properties"]["UnitofMeasure"]; + return latest(meta["Readings"]) + " " + + meta["Properties"]["UnitofMeasure"]; } else if (meta['Actuator']['Model'] == 'binary') { return makeBinaryActuator(path, meta); } else if (meta['Actuator']['Model'] == 'discrete') {