Added device list
This commit is contained in:
Vendored
+107
-75
@@ -1,6 +1,92 @@
|
||||
webpackJsonp([1,4],{
|
||||
|
||||
/***/ 329:
|
||||
/***/ 215:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__ = __webpack_require__(674);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(307);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DataService; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
|
||||
|
||||
|
||||
var DataService = (function () {
|
||||
function DataService(http) {
|
||||
this.http = http;
|
||||
this.baseUrl = '/webapi/data';
|
||||
this.deviceUrl = '/webapi/device';
|
||||
}
|
||||
DataService.prototype.get = function () {
|
||||
var lineChartData$ =
|
||||
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
|
||||
this.http
|
||||
.get(("" + this.baseUrl), { headers: this.getHeaders() })
|
||||
.map(mapData);
|
||||
return lineChartData$;
|
||||
};
|
||||
DataService.prototype.devices = function () {
|
||||
var devices$ =
|
||||
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
|
||||
this.http
|
||||
.get(("" + this.deviceUrl), { headers: this.getHeaders() })
|
||||
.map(mapDevice);
|
||||
return devices$;
|
||||
};
|
||||
DataService.prototype.getHeaders = function () {
|
||||
var headers = new __WEBPACK_IMPORTED_MODULE_2__angular_http__["b" /* Headers */]();
|
||||
headers.append('Accept', 'application/json');
|
||||
return headers;
|
||||
};
|
||||
DataService = __decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */]) === 'function' && _a) || Object])
|
||||
], DataService);
|
||||
return DataService;
|
||||
var _a;
|
||||
}());
|
||||
function mapData(response) {
|
||||
var nums = response.json().map(toData);
|
||||
var times = response.json().map(timeToData);
|
||||
var line = ({ data: nums, label: "Energieverbruik" });
|
||||
var label = ({ data: times });
|
||||
var graph = ({ lines: line, labels: label });
|
||||
return graph;
|
||||
}
|
||||
function toData(r) {
|
||||
var num = r.TOE1;
|
||||
return num;
|
||||
}
|
||||
function timeToData(r) {
|
||||
var times = r.time.substring(11, 19);
|
||||
return times;
|
||||
}
|
||||
function mapDevice(response) {
|
||||
var devices = response.json().map(toDevice);
|
||||
return devices;
|
||||
}
|
||||
function toDevice(r) {
|
||||
var device = ({
|
||||
sn: r.SN,
|
||||
name: r.name
|
||||
});
|
||||
return device;
|
||||
}
|
||||
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/data.service.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 330:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@@ -32,77 +118,12 @@ var DashboardComponent = (function () {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 330:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__ = __webpack_require__(674);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(306);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DataService; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
|
||||
|
||||
|
||||
var DataService = (function () {
|
||||
function DataService(http) {
|
||||
this.http = http;
|
||||
this.baseUrl = '/webapi/data';
|
||||
}
|
||||
DataService.prototype.get = function () {
|
||||
var lineChartData$ =
|
||||
//<LineData>( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );
|
||||
this.http
|
||||
.get(("" + this.baseUrl), { headers: this.getHeaders() })
|
||||
.map(mapData);
|
||||
return lineChartData$;
|
||||
};
|
||||
DataService.prototype.getHeaders = function () {
|
||||
var headers = new __WEBPACK_IMPORTED_MODULE_2__angular_http__["b" /* Headers */]();
|
||||
headers.append('Accept', 'application/json');
|
||||
return headers;
|
||||
};
|
||||
DataService = __decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_2__angular_http__["c" /* Http */]) === 'function' && _a) || Object])
|
||||
], DataService);
|
||||
return DataService;
|
||||
var _a;
|
||||
}());
|
||||
function mapData(response) {
|
||||
var nums = response.json().map(toData);
|
||||
var times = response.json().map(timeToData);
|
||||
var line = ({ data: nums, label: "Energieverbruik" });
|
||||
var label = ({ data: times });
|
||||
var graph = ({ lines: line, labels: label });
|
||||
return graph;
|
||||
}
|
||||
function toData(r) {
|
||||
var num = r.TOE1;
|
||||
return num;
|
||||
}
|
||||
function timeToData(r) {
|
||||
var times = r.time.substring(11, 19);
|
||||
return times;
|
||||
}
|
||||
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/data.service.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 331:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_service__ = __webpack_require__(215);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DeviceComponent; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@@ -114,17 +135,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
|
||||
|
||||
var DeviceComponent = (function () {
|
||||
function DeviceComponent() {
|
||||
function DeviceComponent(dataService) {
|
||||
this.dataService = dataService;
|
||||
}
|
||||
DeviceComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.dataService
|
||||
.devices()
|
||||
.subscribe(function (res) {
|
||||
_this.devices = res;
|
||||
});
|
||||
};
|
||||
DeviceComponent = __decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
|
||||
selector: 'device',
|
||||
template: __webpack_require__(670)
|
||||
}),
|
||||
__metadata('design:paramtypes', [])
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */]) === 'function' && _a) || Object])
|
||||
], DeviceComponent);
|
||||
return DeviceComponent;
|
||||
var _a;
|
||||
}());
|
||||
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/device.component.js.map
|
||||
|
||||
@@ -171,7 +203,7 @@ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dyna
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__(495);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboard_component__ = __webpack_require__(329);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboard_component__ = __webpack_require__(330);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__device_component__ = __webpack_require__(331);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppRoutingModule; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
@@ -249,15 +281,15 @@ var AppComponent = (function () {
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(148);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(466);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(306);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(307);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(369);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_routing_module__ = __webpack_require__(506);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_component__ = __webpack_require__(507);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__chart_component__ = __webpack_require__(509);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__dashboard_component__ = __webpack_require__(329);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__dashboard_component__ = __webpack_require__(330);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__device_component__ = __webpack_require__(331);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__data_service__ = __webpack_require__(330);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__data_service__ = __webpack_require__(215);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@@ -313,7 +345,7 @@ var AppModule = (function () {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_service__ = __webpack_require__(330);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_service__ = __webpack_require__(215);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__ = __webpack_require__(369);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LineChartComponent; });
|
||||
@@ -445,7 +477,7 @@ module.exports = "<div>\r\n\t<line-chart></line-chart>\r\n</div>"
|
||||
/***/ 670:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = "<line-chart></line-chart>"
|
||||
module.exports = "<div>\r\n\r\n<ul>\r\n <li *ngFor=\"let device of devices\">\r\n <span class=\"badge\"> {{device.sn}} </span> {{device.name}}\r\n </li>\r\n</ul>\r\n\r\n</div>"
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user