More data and another graph
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -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"
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<div *ngIf="loaded">
|
||||
<line-chart [label]="label" [data]="data"></line-chart>
|
||||
|
||||
<line-chart [label]="label" [data]="data2"></line-chart>
|
||||
</div>
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user