Debug info
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+6
-12
@@ -100,10 +100,7 @@ function timeToData(r) {
|
||||
return times;
|
||||
}
|
||||
function mapUsage(response) {
|
||||
var usage = response.json().map(toUsage);
|
||||
return usage;
|
||||
}
|
||||
function toUsage(r) {
|
||||
var r = response.json();
|
||||
var usage = ({
|
||||
hov: r.HOV,
|
||||
htv: r.HTV,
|
||||
@@ -195,7 +192,6 @@ var DetailComponent = (function () {
|
||||
DetailComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
var id = this.route.snapshot.params['id'];
|
||||
console.log("DetailComponentID= " + id);
|
||||
this.dataService
|
||||
.get(id)
|
||||
.subscribe(function (res) {
|
||||
@@ -203,11 +199,12 @@ var DetailComponent = (function () {
|
||||
_this.data = res.TOE1;
|
||||
_this.data2 = res.HOV;
|
||||
_this.loaded = true;
|
||||
console.log("Data loaded from API");
|
||||
});
|
||||
this.dataService
|
||||
.usage(id)
|
||||
.subscribe(function (res) {
|
||||
console.log("RES:");
|
||||
console.log(res);
|
||||
_this.hov = res.hov;
|
||||
_this.htv = res.htv;
|
||||
_this.ht = res.ht;
|
||||
@@ -215,6 +212,8 @@ var DetailComponent = (function () {
|
||||
this.dataService
|
||||
.name(id)
|
||||
.subscribe(function (res) {
|
||||
console.log("RES:");
|
||||
console.log(res);
|
||||
_this.name = res;
|
||||
});
|
||||
};
|
||||
@@ -520,16 +519,11 @@ var LineChartComponent = (function () {
|
||||
this.lineChartType = 'line';
|
||||
}
|
||||
LineChartComponent.prototype.ngOnInit = function () {
|
||||
console.log("Initializing Chart");
|
||||
this.lineChartLabels = this.label.data.slice();
|
||||
console.log("Updated labels array");
|
||||
console.log(this.lineChartLabels);
|
||||
var newDataSet = [];
|
||||
var newLine = { data: this.data.data, label: this.data.label };
|
||||
newDataSet.push(newLine);
|
||||
this.lineChartData = newDataSet;
|
||||
console.log("Updated lines array");
|
||||
console.log(this.lineChartData);
|
||||
//this.chart.chart.update();
|
||||
};
|
||||
__decorate([
|
||||
@@ -619,7 +613,7 @@ module.exports = "<div class=\"container\">\r\n\r\n <nav class=\"navbar navbar-
|
||||
/***/ 671:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = "<div class=\"row\">\r\n <div class=\"col-md-6\">\r\n <div style=\"display: block;\">\r\n <canvas baseChart width=\"400\" height=\"400\"\r\n [datasets]=\"lineChartData\"\r\n [labels]=\"lineChartLabels\"\r\n [options]=\"lineChartOptions\"\r\n [colors]=\"lineChartColors\"\r\n [legend]=\"lineChartLegend\"\r\n [chartType]=\"lineChartType\"></canvas>\r\n </div>\r\n </div>\r\n</div>"
|
||||
module.exports = "<div style=\"display: block;\">\r\n<canvas baseChart width=\"400\" height=\"400\"\r\n [datasets]=\"lineChartData\"\r\n [labels]=\"lineChartLabels\"\r\n [options]=\"lineChartOptions\"\r\n [colors]=\"lineChartColors\"\r\n [legend]=\"lineChartLegend\"\r\n [chartType]=\"lineChartType\"></canvas>\r\n</div>"
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -52,7 +52,7 @@ router.get('/usage/:device', function(req, res) {
|
||||
let devid = req.params.device;
|
||||
|
||||
connection.query(
|
||||
'SELECT TOP 1 HOV, HTV, HT FROM measurement WHERE device = ? ORDER BY time DESC', [devid],
|
||||
'SELECT HOV, HTV, HT FROM measurement WHERE device = ? ORDER BY time DESC LIMIT 0,1', [devid],
|
||||
function (error, results, fields) {
|
||||
if (error) throw error;
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div style="display: block;">
|
||||
<canvas baseChart width="400" height="400"
|
||||
[datasets]="lineChartData"
|
||||
[labels]="lineChartLabels"
|
||||
[options]="lineChartOptions"
|
||||
[colors]="lineChartColors"
|
||||
[legend]="lineChartLegend"
|
||||
[chartType]="lineChartType"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: block;">
|
||||
<canvas baseChart width="400" height="400"
|
||||
[datasets]="lineChartData"
|
||||
[labels]="lineChartLabels"
|
||||
[options]="lineChartOptions"
|
||||
[colors]="lineChartColors"
|
||||
[legend]="lineChartLegend"
|
||||
[chartType]="lineChartType"></canvas>
|
||||
</div>
|
||||
@@ -46,22 +46,13 @@ export class LineChartComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
console.log("Initializing Chart");
|
||||
|
||||
this.lineChartLabels = this.label.data.slice();
|
||||
|
||||
console.log("Updated labels array");
|
||||
console.log(this.lineChartLabels);
|
||||
|
||||
const newDataSet = [];
|
||||
const newLine = {data: this.data.data, label: this.data.label};
|
||||
newDataSet.push(newLine);
|
||||
this.lineChartData = newDataSet;
|
||||
|
||||
console.log("Updated lines array");
|
||||
console.log(this.lineChartData);
|
||||
|
||||
//this.chart.chart.update();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,11 +110,8 @@ function timeToData(r:any){
|
||||
|
||||
|
||||
function mapUsage(response:Response): Usage {
|
||||
let usage = response.json().map(toUsage);
|
||||
return usage;
|
||||
}
|
||||
let r = response.json();
|
||||
|
||||
function toUsage(r:any){
|
||||
let usage = <Usage>({
|
||||
hov: r.HOV,
|
||||
htv: r.HTV,
|
||||
|
||||
@@ -32,7 +32,6 @@ export class DetailComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
|
||||
let id = this.route.snapshot.params['id'];
|
||||
console.log("DetailComponentID= " + id);
|
||||
|
||||
this.dataService
|
||||
.get(id)
|
||||
@@ -43,7 +42,6 @@ export class DetailComponent implements OnInit {
|
||||
this.data2 = res.HOV;
|
||||
|
||||
this.loaded = true;
|
||||
console.log("Data loaded from API");
|
||||
|
||||
});
|
||||
|
||||
@@ -51,6 +49,9 @@ export class DetailComponent implements OnInit {
|
||||
.usage(id)
|
||||
.subscribe(res => {
|
||||
|
||||
console.log("RES:");
|
||||
console.log(res);
|
||||
|
||||
this.hov = res.hov;
|
||||
this.htv = res.htv;
|
||||
this.ht = res.ht;
|
||||
@@ -61,12 +62,13 @@ export class DetailComponent implements OnInit {
|
||||
.name(id)
|
||||
.subscribe(res => {
|
||||
|
||||
console.log("RES:");
|
||||
console.log(res);
|
||||
|
||||
this.name = res;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user