Added more api data

This commit is contained in:
2017-04-05 12:35:20 +02:00
parent f5381f0cc2
commit d773389a4b
6 changed files with 9 additions and 9 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -27,11 +27,11 @@ var DataService = (function () {
this.baseUrl = '/webapi/data';
this.deviceUrl = '/webapi/device';
}
DataService.prototype.get = function () {
DataService.prototype.get = function (id) {
var lineChartData$ =
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
this.http
.get(("" + this.baseUrl), { headers: this.getHeaders() })
.get((this.baseUrl + "/" + id), { headers: this.getHeaders() })
.map(mapData);
return lineChartData$;
};
@@ -393,7 +393,7 @@ var LineChartComponent = (function () {
LineChartComponent.prototype.ngOnInit = function () {
var _this = this;
this.dataService
.get()
.get("204B413655303031363639353836343132")
.subscribe(function (res) {
console.log("Received from service:");
console.log(res);
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -49,7 +49,7 @@ router.get('/data/:device', function(req, res) {
router.get('/data', function(req, res) {
connection.query(
'SELECT TOE1, time FROM measurement ORDER BY time DESC LIMIT 0,10',
'SELECT TOE1, TOE2, HOV, HT, time FROM measurement ORDER BY time DESC LIMIT 0,10',
function (error, results, fields) {
if (error) throw error;
+1 -1
View File
@@ -43,7 +43,7 @@ export class LineChartComponent implements OnInit {
ngOnInit(): void {
this.dataService
.get()
.get("204B413655303031363639353836343132")
.subscribe(res => {
console.log("Received from service:");
console.log(res);
+2 -2
View File
@@ -16,11 +16,11 @@ export class DataService {
constructor(private http : Http){}
get(): Observable<GraphData> {
get(id:string): Observable<GraphData> {
let lineChartData$ =
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
this.http
.get((`${this.baseUrl}`)
.get((`${this.baseUrl}/${id}`)
, {headers: this.getHeaders()})
.map(mapData);