From 2c1dd69ce531132ff0b604f76728512fee88657c Mon Sep 17 00:00:00 2001 From: insanity Date: Tue, 10 Apr 2018 21:37:09 +0900 Subject: [PATCH] all menu pages --- .../layout/menu/app.menu.component.ts | 2 +- .../pages/alert/alert-page-routing.module.ts | 18 +++ src/app/pages/alert/alert-page.component.html | 1 + .../pages/alert/alert-page.component.spec.ts | 25 ++++ src/app/pages/alert/alert-page.component.ts | 16 +++ src/app/pages/alert/alert-page.module.ts | 17 +++ .../dashboard-page-routing.module.ts | 17 +++ .../dashboard/dashboard-page.component.html | 1 + .../dashboard-page.component.spec.ts | 25 ++++ .../dashboard/dashboard-page.component.ts | 21 +++ .../pages/dashboard/dashboard-page.module.ts | 15 ++ src/app/pages/infra/infra-page.component.html | 3 +- src/app/pages/infra/infra-page.module.ts | 4 +- src/app/pages/log/log-page-routing.module.ts | 18 +++ src/app/pages/log/log-page.component.html | 1 + src/app/pages/log/log-page.component.spec.ts | 25 ++++ src/app/pages/log/log-page.component.ts | 16 +++ src/app/pages/log/log-page.module.ts | 16 +++ .../overview/overview-page-routing.module.ts | 16 +++ .../overview/overview-page.component.html | 1 + .../overview/overview-page.component.spec.ts | 25 ++++ .../pages/overview/overview-page.component.ts | 14 ++ .../pages/overview/overview-page.module.ts | 19 +++ src/app/pages/pages-routing.module.ts | 8 +- .../report/report-page-routing.module.ts | 18 +++ .../pages/report/report-page.component.html | 1 + .../report/report-page.component.spec.ts | 25 ++++ src/app/pages/report/report-page.component.ts | 16 +++ src/app/pages/report/report-page.module.ts | 16 +++ src/app/pages/sensor/sensor-page.module.ts | 4 +- .../pages/sensors/sensors-page.component.html | 4 +- src/app/pages/sensors/sensors-page.module.ts | 4 +- src/packages/infra/component/index.ts | 8 +- .../infra/component/map/map.component.html | 7 +- .../infra/component/map/map.component.scss | 78 ----------- .../infra/component/map/map.component.ts | 21 +++ src/packages/infra/infra.module.ts | 62 ++++----- src/packages/sensor/component/index.ts | 8 +- .../sensor/component/list/list.component.html | 56 +------- .../sensor/component/list/list.component.ts | 129 +++++++++--------- src/packages/sensor/sensor.module.ts | 74 +++++----- 41 files changed, 549 insertions(+), 306 deletions(-) create mode 100644 src/app/pages/alert/alert-page-routing.module.ts create mode 100644 src/app/pages/alert/alert-page.component.html create mode 100644 src/app/pages/alert/alert-page.component.spec.ts create mode 100644 src/app/pages/alert/alert-page.component.ts create mode 100644 src/app/pages/alert/alert-page.module.ts create mode 100644 src/app/pages/dashboard/dashboard-page-routing.module.ts create mode 100644 src/app/pages/dashboard/dashboard-page.component.html create mode 100644 src/app/pages/dashboard/dashboard-page.component.spec.ts create mode 100644 src/app/pages/dashboard/dashboard-page.component.ts create mode 100644 src/app/pages/dashboard/dashboard-page.module.ts create mode 100644 src/app/pages/log/log-page-routing.module.ts create mode 100644 src/app/pages/log/log-page.component.html create mode 100644 src/app/pages/log/log-page.component.spec.ts create mode 100644 src/app/pages/log/log-page.component.ts create mode 100644 src/app/pages/log/log-page.module.ts create mode 100644 src/app/pages/overview/overview-page-routing.module.ts create mode 100644 src/app/pages/overview/overview-page.component.html create mode 100644 src/app/pages/overview/overview-page.component.spec.ts create mode 100644 src/app/pages/overview/overview-page.component.ts create mode 100644 src/app/pages/overview/overview-page.module.ts create mode 100644 src/app/pages/report/report-page-routing.module.ts create mode 100644 src/app/pages/report/report-page.component.html create mode 100644 src/app/pages/report/report-page.component.spec.ts create mode 100644 src/app/pages/report/report-page.component.ts create mode 100644 src/app/pages/report/report-page.module.ts delete mode 100644 src/packages/infra/component/map/map.component.scss create mode 100644 src/packages/infra/component/map/map.component.ts diff --git a/src/app/commons/component/layout/menu/app.menu.component.ts b/src/app/commons/component/layout/menu/app.menu.component.ts index da4aad7..bdfbe21 100644 --- a/src/app/commons/component/layout/menu/app.menu.component.ts +++ b/src/app/commons/component/layout/menu/app.menu.component.ts @@ -30,7 +30,7 @@ export class AppMenuComponent implements OnInit { { label: 'Monitor', icon: 'remove_red_eye', items: [ { label: 'Overview', icon: 'rate_review', routerLink: ['/overview'] }, - { label: 'Dashboards', icon: 'dashboard', routerLink: ['/dashboards'] }, + { label: 'Dashboards', icon: 'dashboard', routerLink: ['/dashboard'] }, ] }, { label: 'Alert', icon: 'warning', routerLink: ['/alert'] }, diff --git a/src/app/pages/alert/alert-page-routing.module.ts b/src/app/pages/alert/alert-page-routing.module.ts new file mode 100644 index 0000000..85497e8 --- /dev/null +++ b/src/app/pages/alert/alert-page-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { AlertPageComponent } from './alert-page.component'; + +const routes: Routes = [ + { + path: '', + component: AlertPageComponent, + children: [ + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AlertPageRoutingModule { } diff --git a/src/app/pages/alert/alert-page.component.html b/src/app/pages/alert/alert-page.component.html new file mode 100644 index 0000000..7062196 --- /dev/null +++ b/src/app/pages/alert/alert-page.component.html @@ -0,0 +1 @@ +
alert page
\ No newline at end of file diff --git a/src/app/pages/alert/alert-page.component.spec.ts b/src/app/pages/alert/alert-page.component.spec.ts new file mode 100644 index 0000000..0d31af9 --- /dev/null +++ b/src/app/pages/alert/alert-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AlertPageComponent } from './alert-page.component'; + +describe('AlertPageComponent', () => { + let component: AlertPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AlertPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AlertPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/alert/alert-page.component.ts b/src/app/pages/alert/alert-page.component.ts new file mode 100644 index 0000000..202a915 --- /dev/null +++ b/src/app/pages/alert/alert-page.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'of-pages-alert', + templateUrl: './alert-page.component.html', +}) +export class AlertPageComponent implements OnInit { + + constructor(private route: ActivatedRoute, private router: Router) { + } + + ngOnInit() { + } + +} diff --git a/src/app/pages/alert/alert-page.module.ts b/src/app/pages/alert/alert-page.module.ts new file mode 100644 index 0000000..8c53d23 --- /dev/null +++ b/src/app/pages/alert/alert-page.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { AlertPageRoutingModule } from './alert-page-routing.module'; +import { AlertPageComponent } from './alert-page.component'; + +@NgModule({ + imports: [ + CommonModule, + AlertPageRoutingModule, + // NotificationModule, + ], + declarations: [ + AlertPageComponent, + ] +}) +export class AlertPageModule { } diff --git a/src/app/pages/dashboard/dashboard-page-routing.module.ts b/src/app/pages/dashboard/dashboard-page-routing.module.ts new file mode 100644 index 0000000..d8ecaac --- /dev/null +++ b/src/app/pages/dashboard/dashboard-page-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {DashboardPageComponent} from './dashboard-page.component'; + +const routes: Routes = [ + { + path: '', + component: DashboardPageComponent, + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) + +export class DashboardPageRoutingModule { } diff --git a/src/app/pages/dashboard/dashboard-page.component.html b/src/app/pages/dashboard/dashboard-page.component.html new file mode 100644 index 0000000..97f9e07 --- /dev/null +++ b/src/app/pages/dashboard/dashboard-page.component.html @@ -0,0 +1 @@ +
dashboard-page
\ No newline at end of file diff --git a/src/app/pages/dashboard/dashboard-page.component.spec.ts b/src/app/pages/dashboard/dashboard-page.component.spec.ts new file mode 100644 index 0000000..de1ed64 --- /dev/null +++ b/src/app/pages/dashboard/dashboard-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardPageComponent } from './dashboard-page.component'; + +describe('DashboardPageComponent', () => { + let component: DashboardPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DashboardPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DashboardPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/dashboard/dashboard-page.component.ts b/src/app/pages/dashboard/dashboard-page.component.ts new file mode 100644 index 0000000..c4dce73 --- /dev/null +++ b/src/app/pages/dashboard/dashboard-page.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; +import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks'; + + +@Component({ + selector: 'of-dashboard-page', + templateUrl: './dashboard-page.component.html', +}) + +export class DashboardPageComponent implements OnInit, AfterContentInit { + + + constructor() { } + + ngAfterContentInit() { + } + + ngOnInit() { + } + +} diff --git a/src/app/pages/dashboard/dashboard-page.module.ts b/src/app/pages/dashboard/dashboard-page.module.ts new file mode 100644 index 0000000..9b695c9 --- /dev/null +++ b/src/app/pages/dashboard/dashboard-page.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { DashboardPageRoutingModule } from './dashboard-page-routing.module'; +import { DashboardPageComponent } from './dashboard-page.component'; + +@NgModule({ + imports: [ + CommonModule, + DashboardPageRoutingModule, + ], + declarations: [ + DashboardPageComponent + ] +}) +export class DashboardPageModule { } diff --git a/src/app/pages/infra/infra-page.component.html b/src/app/pages/infra/infra-page.component.html index f06ca11..a53e928 100644 --- a/src/app/pages/infra/infra-page.component.html +++ b/src/app/pages/infra/infra-page.component.html @@ -1,2 +1 @@ - -
infra page
+ diff --git a/src/app/pages/infra/infra-page.module.ts b/src/app/pages/infra/infra-page.module.ts index c07f22e..3cf4872 100644 --- a/src/app/pages/infra/infra-page.module.ts +++ b/src/app/pages/infra/infra-page.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { InfraPageRoutingModule } from './infra-page-routing.module'; -// import { InfraModule } from 'packages/infra/infra.module'; +import { InfraModule } from 'packages/infra/infra.module'; import { InfraPageComponent } from './infra-page.component'; // import { DiscoveryModule } from 'packages/discovery/discovery.module'; @@ -11,7 +11,7 @@ import { InfraPageComponent } from './infra-page.component'; imports: [ CommonModule, InfraPageRoutingModule, - // InfraModule, + InfraModule, // DiscoveryModule ], declarations: [ diff --git a/src/app/pages/log/log-page-routing.module.ts b/src/app/pages/log/log-page-routing.module.ts new file mode 100644 index 0000000..96df071 --- /dev/null +++ b/src/app/pages/log/log-page-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { LogPageComponent } from './log-page.component'; + +const routes: Routes = [ + { + path: '', + component: LogPageComponent, + children: [ + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class LogPageRoutingModule { } diff --git a/src/app/pages/log/log-page.component.html b/src/app/pages/log/log-page.component.html new file mode 100644 index 0000000..2cacd87 --- /dev/null +++ b/src/app/pages/log/log-page.component.html @@ -0,0 +1 @@ +
log page
\ No newline at end of file diff --git a/src/app/pages/log/log-page.component.spec.ts b/src/app/pages/log/log-page.component.spec.ts new file mode 100644 index 0000000..6296272 --- /dev/null +++ b/src/app/pages/log/log-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LogPageComponent } from './log-page.component'; + +describe('AlertPageComponent', () => { + let component: LogPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LogPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LogPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/log/log-page.component.ts b/src/app/pages/log/log-page.component.ts new file mode 100644 index 0000000..fa50b30 --- /dev/null +++ b/src/app/pages/log/log-page.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'of-pages-log', + templateUrl: './log-page.component.html', +}) +export class LogPageComponent implements OnInit { + + constructor(private route: ActivatedRoute, private router: Router) { + } + + ngOnInit() { + } + +} diff --git a/src/app/pages/log/log-page.module.ts b/src/app/pages/log/log-page.module.ts new file mode 100644 index 0000000..0a1306b --- /dev/null +++ b/src/app/pages/log/log-page.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { LogPageRoutingModule } from './log-page-routing.module'; +import { LogPageComponent } from './log-page.component'; + +@NgModule({ + imports: [ + CommonModule, + LogPageRoutingModule, + ], + declarations: [ + LogPageComponent, + ] +}) +export class LogPageModule { } diff --git a/src/app/pages/overview/overview-page-routing.module.ts b/src/app/pages/overview/overview-page-routing.module.ts new file mode 100644 index 0000000..7fb3ddc --- /dev/null +++ b/src/app/pages/overview/overview-page-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { OverviewPageComponent } from 'app/pages/overview/overview-page.component'; + +const routes: Routes = [ + { + path: '', + component: OverviewPageComponent, + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class OverviewPageRoutingModule { } diff --git a/src/app/pages/overview/overview-page.component.html b/src/app/pages/overview/overview-page.component.html new file mode 100644 index 0000000..df1723e --- /dev/null +++ b/src/app/pages/overview/overview-page.component.html @@ -0,0 +1 @@ +
overview-page
\ No newline at end of file diff --git a/src/app/pages/overview/overview-page.component.spec.ts b/src/app/pages/overview/overview-page.component.spec.ts new file mode 100644 index 0000000..c0c5051 --- /dev/null +++ b/src/app/pages/overview/overview-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OverviewPageComponent } from './overview-page.component'; + +describe('OverviewComponent', () => { + let component: OverviewPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OverviewPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OverviewPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/overview/overview-page.component.ts b/src/app/pages/overview/overview-page.component.ts new file mode 100644 index 0000000..f99d077 --- /dev/null +++ b/src/app/pages/overview/overview-page.component.ts @@ -0,0 +1,14 @@ +import { Component, OnInit, Inject } from '@angular/core'; + +@Component({ + selector: 'of-page-overview', + templateUrl: './overview-page.component.html', +}) +export class OverviewPageComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/pages/overview/overview-page.module.ts b/src/app/pages/overview/overview-page.module.ts new file mode 100644 index 0000000..af70f98 --- /dev/null +++ b/src/app/pages/overview/overview-page.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { OverviewPageRoutingModule } from 'app/pages/overview/overview-page-routing.module'; +import { OverviewPageComponent } from 'app/pages/overview/overview-page.component'; + + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + OverviewPageRoutingModule, + ], + declarations: [ + OverviewPageComponent, + ] +}) +export class OverviewPageModule { } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index eaddb29..6523f95 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -17,10 +17,12 @@ const routes: Routes = [ { path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' }, // { path: 'sensor-setting', loadChildren: './sensor-setting/sensor-setting-page.module#SensorSettingPageModule' }, // { path: 'target', loadChildren: './target/target-page.module#TargetPageModule' }, - // { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' }, - // { path: 'dashboard', loadChildren: './dashboard/dashboard-page.module#DashboardPageModule' }, + { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' }, + { path: 'dashboard', loadChildren: './dashboard/dashboard-page.module#DashboardPageModule' }, // { path: 'notification', loadChildren: './notification/notification-page.module#NotificationPageModule' }, - // { path: 'alert', loadChildren: './alert/alert-page.module#AlertPageModule' }, + { path: 'alert', loadChildren: './alert/alert-page.module#AlertPageModule' }, + { path: 'report', loadChildren: './report/report-page.module#ReportPageModule' }, + { path: 'log', loadChildren: './log/log-page.module#LogPageModule' }, // { path: 'settings/member', loadChildren: './settings/member/member-page.module#MemberPageModule' }, ] } diff --git a/src/app/pages/report/report-page-routing.module.ts b/src/app/pages/report/report-page-routing.module.ts new file mode 100644 index 0000000..9896c88 --- /dev/null +++ b/src/app/pages/report/report-page-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { ReportPageComponent } from './report-page.component'; + +const routes: Routes = [ + { + path: '', + component: ReportPageComponent, + children: [ + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ReportPageRoutingModule { } diff --git a/src/app/pages/report/report-page.component.html b/src/app/pages/report/report-page.component.html new file mode 100644 index 0000000..b72d7dd --- /dev/null +++ b/src/app/pages/report/report-page.component.html @@ -0,0 +1 @@ +
report page
\ No newline at end of file diff --git a/src/app/pages/report/report-page.component.spec.ts b/src/app/pages/report/report-page.component.spec.ts new file mode 100644 index 0000000..3583b2e --- /dev/null +++ b/src/app/pages/report/report-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AlertPageComponent } from './report-page.component'; + +describe('AlertPageComponent', () => { + let component: AlertPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AlertPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AlertPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/report/report-page.component.ts b/src/app/pages/report/report-page.component.ts new file mode 100644 index 0000000..6b8c3bb --- /dev/null +++ b/src/app/pages/report/report-page.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'of-pages-report', + templateUrl: './report-page.component.html', +}) +export class ReportPageComponent implements OnInit { + + constructor(private route: ActivatedRoute, private router: Router) { + } + + ngOnInit() { + } + +} diff --git a/src/app/pages/report/report-page.module.ts b/src/app/pages/report/report-page.module.ts new file mode 100644 index 0000000..eba7dd6 --- /dev/null +++ b/src/app/pages/report/report-page.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { ReportPageRoutingModule } from './report-page-routing.module'; +import { ReportPageComponent } from './report-page.component'; + +@NgModule({ + imports: [ + CommonModule, + ReportPageRoutingModule, + ], + declarations: [ + ReportPageComponent, + ] +}) +export class ReportPageModule { } diff --git a/src/app/pages/sensor/sensor-page.module.ts b/src/app/pages/sensor/sensor-page.module.ts index ea14feb..a4e8977 100644 --- a/src/app/pages/sensor/sensor-page.module.ts +++ b/src/app/pages/sensor/sensor-page.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -// import { SensorModule } from 'packages/sensor/sensor.module'; +import { SensorModule } from 'packages/sensor/sensor.module'; import { SensorPageRoutingModule } from './sensor-page-routing.module'; import { SensorPageComponent } from './sensor-page.component'; @@ -9,7 +9,7 @@ import { SensorPageComponent } from './sensor-page.component'; imports: [ CommonModule, SensorPageRoutingModule, - // SensorModule, + SensorModule, ], declarations: [ SensorPageComponent, diff --git a/src/app/pages/sensors/sensors-page.component.html b/src/app/pages/sensors/sensors-page.component.html index 869c69a..6844dda 100644 --- a/src/app/pages/sensors/sensors-page.component.html +++ b/src/app/pages/sensors/sensors-page.component.html @@ -1,3 +1 @@ -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/src/app/pages/sensors/sensors-page.module.ts b/src/app/pages/sensors/sensors-page.module.ts index afd0493..800fa19 100644 --- a/src/app/pages/sensors/sensors-page.module.ts +++ b/src/app/pages/sensors/sensors-page.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -// import { SensorModule } from 'packages/sensor/sensor.module'; +import { SensorModule } from 'packages/sensor/sensor.module'; import { SensorsPageComponent } from './sensors-page.component'; import { SensorsPageRoutingModule } from './sensors-page-routing.module'; @@ -8,7 +8,7 @@ import { SensorsPageRoutingModule } from './sensors-page-routing.module'; imports: [ CommonModule, SensorsPageRoutingModule, - // SensorModule + SensorModule ], declarations: [ SensorsPageComponent diff --git a/src/packages/infra/component/index.ts b/src/packages/infra/component/index.ts index bca5cf0..e6615aa 100644 --- a/src/packages/infra/component/index.ts +++ b/src/packages/infra/component/index.ts @@ -1,5 +1,5 @@ -// import { MapComponent } from './map/map.component'; +import { MapComponent } from './map/map.component'; -// export const COMPONENTS = [ -// MapComponent, -// ]; +export const COMPONENTS = [ + MapComponent, +]; diff --git a/src/packages/infra/component/map/map.component.html b/src/packages/infra/component/map/map.component.html index c3970d9..20b1d65 100644 --- a/src/packages/infra/component/map/map.component.html +++ b/src/packages/infra/component/map/map.component.html @@ -1,4 +1,5 @@ -
+
map
+ @@ -46,10 +46,9 @@
-
- \ No newline at end of file + --> \ No newline at end of file diff --git a/src/packages/infra/component/map/map.component.scss b/src/packages/infra/component/map/map.component.scss deleted file mode 100644 index bfcacdd..0000000 --- a/src/packages/infra/component/map/map.component.scss +++ /dev/null @@ -1,78 +0,0 @@ -@mixin infra-list($theme) { - - .infra-list{ - margin: 10px 5px; - background: white; - } - .pull-right{ - flex: 1 1 auto; - } - mat-list-item:hover { - background: #e8eaf6; - cursor: pointer; - } - .mat-chip { - padding: 1px 13px; - } - -} -.nav-item { -transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); -cursor: default; - -&:hover { - transform: translate(0, -8px); - box-shadow: 0 20px 20px rgba(0, 0, 0, .16) -} -} - - -.infra-card { - width: 70%; - } - - .grid-left-align { - position: absolute; - left: 5px; - } - - .add-sensor-button { - position: absolute; - right: 1px; - } - - .box{ - float: left; - width: 13px; - height: 13px; - margin: 5px; - border: 1px solid rgba(0, 0, 0, .2); - } - - .up{ - background: green; - } - .down{ - background: red; - } - .warn{ - background: yellow; - } - .error{ - background:red; - } - - .form { - min-width: 150px; - max-width: 500px; - width: 100%; - } - - .full-width { - width: 100%; - } - - .search-result { - height: 80%; - overflow-y: scroll; - } \ No newline at end of file diff --git a/src/packages/infra/component/map/map.component.ts b/src/packages/infra/component/map/map.component.ts new file mode 100644 index 0000000..011855c --- /dev/null +++ b/src/packages/infra/component/map/map.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit, AfterViewInit, AfterContentInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'of-infra-map', + templateUrl: './map.component.html', +}) +export class MapComponent implements OnInit, AfterContentInit { + + constructor( + private router: Router, + ) { + } + + ngAfterContentInit() { + + } + + ngOnInit() { + } +} diff --git a/src/packages/infra/infra.module.ts b/src/packages/infra/infra.module.ts index a3776f7..07e7082 100644 --- a/src/packages/infra/infra.module.ts +++ b/src/packages/infra/infra.module.ts @@ -1,38 +1,26 @@ -// import { NgModule } from '@angular/core'; -// import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { InfraStoreModule } from './infra-store.module'; +import { COMPONENTS } from './component'; +import { SERVICES } from './service'; +import { FormsModule } from '@angular/forms'; +import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module'; -// import { MaterialModule } from 'packages/commons/material/material.module'; - -// import { InfraStoreModule } from './infra-store.module'; - -// import { COMPONENTS } from './component'; -// import { SERVICES } from './service'; -// import { SensorSettingPageModule } from 'app/pages/sensor-setting/sensor-setting-page.module'; -// import { SensorModule } from '../sensor/sensor.module'; -// import { SettingComponent } from '../sensor/component/setting/setting.component'; -// import { FormsModule } from '@angular/forms'; -// import { InfiniteScrollModule } from 'ngx-infinite-scroll'; - -// @NgModule({ -// imports: [ -// CommonModule, -// MaterialModule, -// InfraStoreModule, -// SensorModule, -// FormsModule, -// InfiniteScrollModule -// ], -// declarations: [ -// COMPONENTS, -// ], -// exports: [ -// COMPONENTS, -// ], -// providers: [ -// SERVICES -// ], -// entryComponents: [ -// SettingComponent, -// ] -// }) -// export class InfraModule { } +@NgModule({ + imports: [ + CommonModule, + InfraStoreModule, + FormsModule, + PrimeNGModules, + ], + declarations: [ + COMPONENTS, + ], + exports: [ + COMPONENTS, + ], + providers: [ + SERVICES + ] +}) +export class InfraModule { } diff --git a/src/packages/sensor/component/index.ts b/src/packages/sensor/component/index.ts index 499477a..245605b 100644 --- a/src/packages/sensor/component/index.ts +++ b/src/packages/sensor/component/index.ts @@ -1,3 +1,5 @@ +import { ListComponent } from './list/list.component'; + // import { SettingComponent } from './setting/setting.component'; // import { SettingResultComponent } from './setting-result/setting-result.component'; // import { FilterComponent } from './list/filter/filter.component'; @@ -10,10 +12,10 @@ // import { SettingETCComponent } from './setting/setting-etc/setting-etc.component'; // import { NameTagComponent } from './name-tag/name-tag.component'; -// export const COMPONENTS = [ +export const COMPONENTS = [ // SettingComponent, // SettingResultComponent, -// ListComponent, + ListComponent, // FilterComponent, // DetailComponent, // TargetSelectorComponent, @@ -22,4 +24,4 @@ // SensorItemSelectorComponent, // SettingETCComponent, // NameTagComponent, -// ]; +]; diff --git a/src/packages/sensor/component/list/list.component.html b/src/packages/sensor/component/list/list.component.html index f522367..60cf01c 100644 --- a/src/packages/sensor/component/list/list.component.html +++ b/src/packages/sensor/component/list/list.component.html @@ -1,55 +1 @@ -
- - -
- -
- - -
-
-
Target :
-
Sensor :
-
Activated Sensor :
-
Inactivated Sensor :
-
- -
-
- -
-
- - - - Target - {{element.target.displayName}} - - - - Crawler - {{element.crawler.name}} - - - - Items - {{element.itemCount}} - - - - Status - {{element.status.name}} - - - - - - - - -
-
- -
- -
\ No newline at end of file +
sensor list
\ No newline at end of file diff --git a/src/packages/sensor/component/list/list.component.ts b/src/packages/sensor/component/list/list.component.ts index 17a1472..7153186 100644 --- a/src/packages/sensor/component/list/list.component.ts +++ b/src/packages/sensor/component/list/list.component.ts @@ -1,81 +1,76 @@ -// import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; -// import { MatTableDataSource, MatSort, MatDialog } from '@angular/material'; -// import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks'; -// import { Router } from '@angular/router'; -// import { Sensor } from '../../model'; +import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; +import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks'; +import { Router } from '@angular/router'; +import { Sensor } from '../../model'; -// import { Store, select } from '@ngrx/store'; +import { Store, select } from '@ngrx/store'; -// import * as SensorStore from '../../store'; +import * as SensorStore from '../../store'; -// import { RPCClientError } from '@loafer/ng-rpc/protocol'; -// import * as ListStore from '../../store/list'; -// import { sensorListSelector } from '../../store'; -// import { Domain } from '../../../domain/model'; -// import { SettingComponent } from '../setting/setting.component'; -// import { AuthSelector } from 'packages/member/store'; -// import { Page, PageParams } from 'app/commons/model'; +import { RPCClientError } from '@loafer/ng-rpc/protocol'; +import * as ListStore from '../../store/list'; +import { sensorListSelector } from '../../store'; +import { Domain } from '../../../domain/model'; +import { AuthSelector } from 'packages/member/store'; +import { Page, PageParams } from 'app/commons/model'; -// @Component({ -// selector: 'of-sensor-list', -// templateUrl: './list.component.html', -// styleUrls: ['./list.component.scss'] -// }) -// export class ListComponent implements OnInit, AfterContentInit { +@Component({ + selector: 'of-sensor-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.scss'] +}) +export class ListComponent implements OnInit, AfterContentInit { -// sensorList$ = this.store.pipe(select(sensorListSelector.select('page'))); + sensorList$ = this.store.pipe(select(sensorListSelector.select('page'))); -// displayedColumns = ['target', 'crawler', 'itemCount', 'status']; -// dataSource: MatTableDataSource; -// @ViewChild(MatSort) sort: MatSort; -// PAGE_SIZE = '10'; -// totalLength = 0; + displayedColumns = ['target', 'crawler', 'itemCount', 'status']; + PAGE_SIZE = '10'; + totalLength = 0; -// constructor(private router: Router, -// private store: Store, -// private dialog: MatDialog, -// ) { } + constructor(private router: Router, + private store: Store, + ) { } -// ngOnInit() { -// this.sensorList$.subscribe( -// (page: Page) => { -// if (page != null) { -// this.totalLength = page.totalElements; -// this.dataSource = new MatTableDataSource(page.content); -// this.dataSource.sort = this.sort; -// } -// }, -// (error: RPCClientError) => { -// console.log(error.response.message); -// } -// ); -// } + ngOnInit() { + this.sensorList$.subscribe( + (page: Page) => { + if (page != null) { + this.totalLength = page.totalElements; + // this.dataSource = new MatTableDataSource(page.content); + // this.dataSource.sort = this.sort; + } + }, + (error: RPCClientError) => { + console.log(error.response.message); + } + ); + } -// ngAfterContentInit() { -// this.getSensors(0); -// } + ngAfterContentInit() { + this.getSensors(0); + } -// getSensors(pageIndex: number) { -// this.store.select(AuthSelector.select('domain')).subscribe( -// (domain: Domain) => { -// const pageParams: PageParams = { -// pageNo: pageIndex + '', -// countPerPage: this.PAGE_SIZE, -// sortCol: 'id', -// sortDirection: 'descending' -// }; + getSensors(pageIndex: number) { + this.store.select(AuthSelector.select('domain')).subscribe( + (domain: Domain) => { + const pageParams: PageParams = { + pageNo: pageIndex + '', + countPerPage: this.PAGE_SIZE, + sortCol: 'id', + sortDirection: 'descending' + }; -// this.store.dispatch(new ListStore.ReadAllByDomain({ domain, pageParams })); -// }, -// (error) => { -// console.log(error); -// } -// ); -// } + this.store.dispatch(new ListStore.ReadAllByDomain({ domain, pageParams })); + }, + (error) => { + console.log(error); + } + ); + } -// handleRowClick(obj: Sensor) { -// this.router.navigate(['target', obj.id]); -// } + handleRowClick(obj: Sensor) { + this.router.navigate(['target', obj.id]); + } // addSensor() { // const dialogRef = this.dialog.open(SettingComponent, { @@ -87,4 +82,4 @@ // }); // } -// } +} diff --git a/src/packages/sensor/sensor.module.ts b/src/packages/sensor/sensor.module.ts index bcb51b2..12c6601 100644 --- a/src/packages/sensor/sensor.module.ts +++ b/src/packages/sensor/sensor.module.ts @@ -1,47 +1,35 @@ -// import { NgModule } from '@angular/core'; -// import { CommonModule } from '@angular/common'; -// import {FormsModule} from '@angular/forms'; +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; -// import { MaterialModule } from 'packages/commons/material/material.module'; - -// import { COMPONENTS } from './component'; -// import { SERVICES } from './service'; -// import { SensorStoreModule } from './sensor-store.module'; -// import { SettingComponent } from './component/setting/setting.component'; -// import { TreeModule } from 'angular-tree-component'; -// import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; -// import { MetaCrawlerModule } from '../meta/crawler/crawler.module'; -// import { MetaCrawlerInputItemModule } from '../meta/crawler-input-item/crawler-input.module'; -// import { MetaSensorDisplayItemModule } from '../meta/sensor-display-item/sensor-display-item.module'; -// import { InfoTableModule } from '../commons/component/info-table/info-table.module'; +import { COMPONENTS } from './component'; +import { SERVICES } from './service'; +import { SensorStoreModule } from './sensor-store.module'; +import { TreeModule } from 'angular-tree-component'; +import { MetaCrawlerModule } from '../meta/crawler/crawler.module'; +import { MetaSensorDisplayItemModule } from '../meta/sensor-display-item/sensor-display-item.module'; // import { SensorItemModule } from '../sensor-item/sensor-item.module'; +// import { MetaCrawlerInputItemModule } from '../meta/crawler-input-item/crawler-input.module'; -// @NgModule({ -// imports: [ -// CommonModule, -// MaterialModule, -// FormsModule, -// SensorStoreModule, -// TreeModule, -// InfoTableModule, -// PerfectScrollbarModule, -// MetaCrawlerModule, -// MetaCrawlerInputItemModule, -// MetaSensorDisplayItemModule, -// SensorItemModule -// ], -// declarations: [ -// COMPONENTS, -// ], -// exports: [ -// COMPONENTS, -// ], -// providers: [ -// SERVICES, -// ], -// entryComponents: [ -// SettingComponent -// ] -// }) -// export class SensorModule { } +@NgModule({ + imports: [ + CommonModule, + FormsModule, + SensorStoreModule, + TreeModule, + MetaCrawlerModule, + MetaSensorDisplayItemModule, + // SensorItemModule + ], + declarations: [ + COMPONENTS, + ], + exports: [ + COMPONENTS, + ], + providers: [ + SERVICES, + ] +}) +export class SensorModule { }