Added more api data
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-3
@@ -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);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user