More data and another graph

This commit is contained in:
2017-04-05 14:35:50 +02:00
parent e08380d0da
commit 0f90a41391
6 changed files with 8 additions and 23 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -171,7 +171,7 @@ var DetailComponent = (function () {
.subscribe(function (res) {
_this.label = res.labels;
_this.data = res.TOE1;
//this.data2 = res.TOE1;
_this.data2 = res.HOV;
_this.loaded = true;
console.log("Data loaded from API");
});
@@ -592,7 +592,7 @@ module.exports = "<div>\r\n\t\r\n</div>"
/***/ 673:
/***/ (function(module, exports) {
module.exports = "<div *ngIf=\"loaded\">\r\n\t<line-chart [label]=\"label\" [data]=\"data\"></line-chart>\r\n</div>\r\n"
module.exports = "<div *ngIf=\"loaded\">\r\n\t<line-chart [label]=\"label\" [data]=\"data\"></line-chart>\r\n\r\n\t<line-chart [label]=\"label\" [data]=\"data2\"></line-chart>\r\n</div>\r\n"
/***/ }),
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -18
View File
@@ -32,24 +32,7 @@ router.get('/data/:device', function(req, res) {
let devid = req.params.device;
connection.query(
'SELECT TOE1, time FROM measurement WHERE device = ? ORDER BY time DESC LIMIT 0,10', [devid],
function (error, results, fields) {
if (error) throw error;
if (results.length > 0) {
res.status(200);
res.send(JSON.stringify(results));
}
});
});
router.get('/data', function(req, res) {
connection.query(
'SELECT TOE1, TOE2, HOV, HT, time FROM measurement ORDER BY time DESC LIMIT 0,10',
'SELECT TOE1, time FROM measurement WHERE device = ? ORDER BY time DESC LIMIT 0,25', [devid],
function (error, results, fields) {
if (error) throw error;
+2
View File
@@ -1,3 +1,5 @@
<div *ngIf="loaded">
<line-chart [label]="label" [data]="data"></line-chart>
<line-chart [label]="label" [data]="data2"></line-chart>
</div>
+1 -1
View File
@@ -34,7 +34,7 @@ export class DetailComponent implements OnInit {
this.label = res.labels;
this.data = res.TOE1;
//this.data2 = res.TOE1;
this.data2 = res.HOV;
this.loaded = true;
console.log("Data loaded from API");