Added new device page

This commit is contained in:
2017-04-05 11:47:27 +02:00
parent eaec53084b
commit 3276942f1b
15 changed files with 840 additions and 776 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+83 -38
View File
@@ -22,7 +22,7 @@ var DashboardComponent = (function () {
DashboardComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'dashboard',
template: __webpack_require__(668)
template: __webpack_require__(669)
}),
__metadata('design:paramtypes', [])
], DashboardComponent);
@@ -37,7 +37,7 @@ var DashboardComponent = (function () {
"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__(672);
/* 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; });
@@ -98,7 +98,39 @@ function timeToData(r) {
/***/ }),
/***/ 386:
/***/ 331:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* 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;
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 DeviceComponent = (function () {
function DeviceComponent() {
}
DeviceComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'device',
template: __webpack_require__(670)
}),
__metadata('design:paramtypes', [])
], DeviceComponent);
return DeviceComponent;
}());
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/device.component.js.map
/***/ }),
/***/ 387:
/***/ (function(module, exports) {
function webpackEmptyContext(req) {
@@ -107,20 +139,20 @@ function webpackEmptyContext(req) {
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = 386;
webpackEmptyContext.id = 387;
/***/ }),
/***/ 387:
/***/ 388:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(475);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(509);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(507);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(510);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(508);
@@ -133,13 +165,14 @@ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dyna
/***/ }),
/***/ 505:
/***/ 506:
/***/ (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__angular_router__ = __webpack_require__(494);
/* 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_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) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -153,9 +186,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: __WEBPACK_IMPORTED_MODULE_2__dashboard_component__["a" /* DashboardComponent */] },
{ path: 'device', component: __WEBPACK_IMPORTED_MODULE_3__device_component__["a" /* DeviceComponent */] }
];
var AppRoutingModule = (function () {
function AppRoutingModule() {
@@ -173,7 +208,7 @@ var AppRoutingModule = (function () {
/***/ }),
/***/ 506:
/***/ 507:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -196,8 +231,8 @@ var AppComponent = (function () {
AppComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'app-root',
template: __webpack_require__(666),
styles: [__webpack_require__(665)]
template: __webpack_require__(667),
styles: [__webpack_require__(666)]
}),
__metadata('design:paramtypes', [])
], AppComponent);
@@ -207,21 +242,22 @@ var AppComponent = (function () {
/***/ }),
/***/ 507:
/***/ 508:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* 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__(465);
/* 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_4_ng2_charts_ng2_charts__ = __webpack_require__(368);
/* 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__(505);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_component__ = __webpack_require__(506);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__chart_component__ = __webpack_require__(508);
/* 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_9__data_service__ = __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 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;
@@ -242,6 +278,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var AppModule = (function () {
function AppModule() {
}
@@ -250,7 +287,8 @@ var AppModule = (function () {
declarations: [
__WEBPACK_IMPORTED_MODULE_6__app_component__["a" /* AppComponent */],
__WEBPACK_IMPORTED_MODULE_7__chart_component__["a" /* LineChartComponent */],
__WEBPACK_IMPORTED_MODULE_8__dashboard_component__["a" /* DashboardComponent */]
__WEBPACK_IMPORTED_MODULE_8__dashboard_component__["a" /* DashboardComponent */],
__WEBPACK_IMPORTED_MODULE_9__device_component__["a" /* DeviceComponent */]
],
imports: [
__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__["a" /* BrowserModule */],
@@ -259,7 +297,7 @@ var AppModule = (function () {
__WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__["ChartsModule"],
__WEBPACK_IMPORTED_MODULE_5__app_routing_module__["a" /* AppRoutingModule */]
],
providers: [__WEBPACK_IMPORTED_MODULE_9__data_service__["a" /* DataService */]],
providers: [__WEBPACK_IMPORTED_MODULE_10__data_service__["a" /* DataService */]],
bootstrap: [__WEBPACK_IMPORTED_MODULE_6__app_component__["a" /* AppComponent */]]
}),
__metadata('design:paramtypes', [])
@@ -270,13 +308,13 @@ var AppModule = (function () {
/***/ }),
/***/ 508:
/***/ 509:
/***/ (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__(330);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__ = __webpack_require__(368);
/* 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; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -349,7 +387,7 @@ var LineChartComponent = (function () {
LineChartComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'line-chart',
template: __webpack_require__(667)
template: __webpack_require__(668)
}),
__metadata('design:paramtypes', [(typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */]) === 'function' && _b) || Object])
], LineChartComponent);
@@ -360,7 +398,7 @@ var LineChartComponent = (function () {
/***/ }),
/***/ 509:
/***/ 510:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -376,41 +414,48 @@ var environment = {
/***/ }),
/***/ 665:
/***/ 666:
/***/ (function(module, exports) {
module.exports = ""
/***/ }),
/***/ 666:
/***/ (function(module, exports) {
module.exports = "<div class=\"container\">\r\n\r\n <nav class=\"navbar navbar-default\">\r\n <div class=\"container-fluid\">\r\n <div class=\"navbar-header\">\r\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\r\n <span class=\"sr-only\">Toggle navigation</span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n </button>\r\n <a class=\"navbar-brand\">Energiemeter</a>\r\n </div>\r\n <div id=\"navbar\" class=\"navbar-collapse collapse\">\r\n <ul class=\"nav navbar-nav\">\r\n <li routerLink=\"/dashboard\" routerLinkActive=\"active\"><a routerLink=\"/dashboard\" routerLinkActive=\"active\">Dashboard</a></li>\r\n </ul>\r\n </div><!--/.nav-collapse -->\r\n </div><!--/.container-fluid -->\r\n </nav>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-12\">\r\n <div class=\"page-header\">\r\n <h1>{{title}} <small>Avans</small></h1>\r\n </div>\r\n </div>\r\n\r\n <router-outlet></router-outlet>\r\n\r\n </div>\r\n</div>\r\n"
/***/ }),
/***/ 667:
/***/ (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 class=\"container\">\r\n\r\n <nav class=\"navbar navbar-default\">\r\n <div class=\"container-fluid\">\r\n <div class=\"navbar-header\">\r\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\r\n <span class=\"sr-only\">Toggle navigation</span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n </button>\r\n <a class=\"navbar-brand\">Energiemeter</a>\r\n </div>\r\n <div id=\"navbar\" class=\"navbar-collapse collapse\">\r\n <ul class=\"nav navbar-nav\">\r\n <li routerLink=\"/dashboard\" routerLinkActive=\"active\"><a routerLink=\"/dashboard\" routerLinkActive=\"active\">Dashboard</a></li>\r\n <li routerLink=\"/device\" routerLinkActive=\"active\"><a routerLink=\"/device\" routerLinkActive=\"active\">Device</a></li>\r\n </ul>\r\n </div><!--/.nav-collapse -->\r\n </div><!--/.container-fluid -->\r\n </nav>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-12\">\r\n <div class=\"page-header\">\r\n <h1>{{title}} <small>Avans</small></h1>\r\n </div>\r\n </div>\r\n\r\n <router-outlet></router-outlet>\r\n\r\n </div>\r\n</div>\r\n"
/***/ }),
/***/ 668:
/***/ (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>"
/***/ }),
/***/ 669:
/***/ (function(module, exports) {
module.exports = "<div>\r\n\t<line-chart></line-chart>\r\n</div>"
/***/ }),
/***/ 687:
/***/ 670:
/***/ (function(module, exports) {
module.exports = "<line-chart></line-chart>"
/***/ }),
/***/ 689:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(387);
module.exports = __webpack_require__(388);
/***/ })
},[687]);
},[689]);
//# sourceMappingURL=main.bundle.map
+1 -1
View File
File diff suppressed because one or more lines are too long
+404 -402
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -10
View File
@@ -1,15 +1,15 @@
webpackJsonp([2,4],{
/***/ 389:
/***/ 390:
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(660);
var content = __webpack_require__(661);
if(typeof content === 'string') content = [[module.i, content, '']];
// add the styles to the DOM
var update = __webpack_require__(685)(content, {});
var update = __webpack_require__(687)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
@@ -27,10 +27,10 @@ if(false) {
/***/ }),
/***/ 660:
/***/ 661:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(661)();
exports = module.exports = __webpack_require__(662)();
// imports
@@ -42,7 +42,7 @@ exports.push([module.i, "/* You can add global styles to this file, and also imp
/***/ }),
/***/ 661:
/***/ 662:
/***/ (function(module, exports) {
/*
@@ -99,7 +99,7 @@ module.exports = function() {
/***/ }),
/***/ 685:
/***/ 687:
/***/ (function(module, exports) {
/*
@@ -352,13 +352,13 @@ function updateLink(linkElement, obj) {
/***/ }),
/***/ 689:
/***/ 691:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(389);
module.exports = __webpack_require__(390);
/***/ })
},[689]);
},[691]);
//# sourceMappingURL=styles.bundle.map
+1 -1
View File
File diff suppressed because one or more lines are too long
+321 -319
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -91,7 +91,6 @@ console.log(toe1);
connection.query(
'INSERT INTO device (SN, name, API) VALUES (?, "New device", 42)', [device],
function (error, results, fields) {
if (error) throw error;
callback();
});
+2
View File
@@ -1,10 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './dashboard.component';
import { DeviceComponent } from './device.component';
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'device', component: DeviceComponent }
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
+1
View File
@@ -14,6 +14,7 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li routerLink="/dashboard" routerLinkActive="active"><a routerLink="/dashboard" routerLinkActive="active">Dashboard</a></li>
<li routerLink="/device" routerLinkActive="active"><a routerLink="/device" routerLinkActive="active">Device</a></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
+3 -1
View File
@@ -9,6 +9,7 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LineChartComponent } from './chart.component';
import { DashboardComponent } from './dashboard.component';
import { DeviceComponent } from './device.component';
import { DataService } from './data.service';
@@ -16,7 +17,8 @@ import { DataService } from './data.service';
declarations: [
AppComponent,
LineChartComponent,
DashboardComponent
DashboardComponent,
DeviceComponent
],
imports: [
BrowserModule,
+1
View File
@@ -0,0 +1 @@
<line-chart></line-chart>
+10
View File
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'device',
templateUrl: './device.component.html'
})
export class DeviceComponent {
}