From e934900a4a5dea0e9d8e3f84bce86da033e73731 Mon Sep 17 00:00:00 2001 From: geek Date: Tue, 5 Jun 2018 20:31:29 +0900 Subject: [PATCH] ing --- .../component/detail/detail.component.ts | 108 +++++++++--------- @overflow/target/component/index.ts | 6 +- .../target/component/list/list.component.html | 1 + .../target/component/list/list.component.ts | 57 +++++---- @overflow/target/service/index.ts | 2 +- @overflow/target/service/target.service.ts | 5 +- @overflow/target/target.module.ts | 4 +- .../probes/probe-tab-page-routing.module.ts | 4 +- .../targets/target-detail-page.component.ts | 4 +- .../targets/target-list-page.component.html | 2 +- .../targets/target-list-page.component.ts | 6 +- .../pages/targets/target-page.component.html | 9 +- .../pages/targets/target-page.component.ts | 22 ++-- src/app/pages/targets/target-page.module.ts | 2 +- 14 files changed, 112 insertions(+), 120 deletions(-) diff --git a/@overflow/target/component/detail/detail.component.ts b/@overflow/target/component/detail/detail.component.ts index bfab400..7bd85e6 100644 --- a/@overflow/target/component/detail/detail.component.ts +++ b/@overflow/target/component/detail/detail.component.ts @@ -19,37 +19,37 @@ import { Target } from '@overflow/commons-typescript/model/target'; }) export class DetailComponent implements OnInit, AfterContentInit, OnDestroy { - infra$: Observable; - infraSubscription$: Subscription; - sensorsSubscription$: Subscription; - // sensors$ = this.sensorListStore.pipe(select(sensorListSelector.select('page'))); - target$: Observable; - - infraId = null; - infra: Infra; - sensors: Sensor[]; - sensorsCount = 0; - sensorSettingDisplay = false; - - pageSize = '10'; - totalLength = 0; - currPage = 0; + // infra$: Observable; + // infraSubscription$: Subscription; + // sensorsSubscription$: Subscription; + // // sensors$ = this.sensorListStore.pipe(select(sensorListSelector.select('page'))); + // target$: Observable; + // + // infraId = null; + // infra: Infra; + // sensors: Sensor[]; + // sensorsCount = 0; + // sensorSettingDisplay = false; + // + // pageSize = '10'; + // totalLength = 0; + // currPage = 0; constructor( - private router: Router, - private route: ActivatedRoute, - private store: Store, + // private router: Router, + // private route: ActivatedRoute, + // private store: Store, ) { } ngOnInit() { - this.infraSubscription$ = this.infra$.subscribe( - (infra: Infra) => { - this.infra = infra; - }, - (error: RPCClientError) => { - console.log(error.response.message); - } - ); + // this.infraSubscription$ = this.infra$.subscribe( + // (infra: Infra) => { + // this.infra = infra; + // }, + // (error: RPCClientError) => { + // console.log(error.response.message); + // } + // ); // this.sensorsSubscription$ = this.sensors$.subscribe( // (page: Page) => { // if (page) { @@ -64,15 +64,15 @@ export class DetailComponent implements OnInit, AfterContentInit, OnDestroy { } ngAfterContentInit() { - this.infraId = this.route.snapshot.paramMap.get('id'); - this.getInfra(); - this.getSensors(this.currPage); + // this.infraId = this.route.snapshot.paramMap.get('id'); + // this.getInfra(); + // this.getSensors(this.currPage); } ngOnDestroy() { - if (this.infraSubscription$) { - this.infraSubscription$.unsubscribe(); - } + // if (this.infraSubscription$) { + // this.infraSubscription$.unsubscribe(); + // } } getInfra() { @@ -98,48 +98,48 @@ export class DetailComponent implements OnInit, AfterContentInit, OnDestroy { } onAddSensor() { - this.sensorSettingDisplay = true; + // this.sensorSettingDisplay = true; } onSensorSettingClose() { - this.sensorSettingDisplay = false; + // this.sensorSettingDisplay = false; } onPaging(e) { - this.getSensors(e.page); + // this.getSensors(e.page); } onRowSelect(event) { - this.router.navigate(['sensor', event.data.id, 'info']); + // this.router.navigate(['sensor', event.data.id, 'info']); } onTraceroute() { - alert('지원 예정'); + // alert('지원 예정'); } onDisplayNameChange(value: string) { - if (value === this.infra.target.displayName) { - return; - } - const target = this.infra.target; - target.displayName = value; + // if (value === this.infra.target.displayName) { + // return; + // } + // const target = this.infra.target; + // target.displayName = value; // this.targetModifyStore.dispatch( // new TargetModifyStore.Modify(target) // ); - const modifySuccessSubscription$: Subscription = this.target$.subscribe( - (t: Target) => { - if (t) { - } - if (modifySuccessSubscription$) { - modifySuccessSubscription$.unsubscribe(); - } - }, - (error: RPCClientError) => { - console.log(error); - } - ); + // const modifySuccessSubscription$: Subscription = this.target$.subscribe( + // (t: Target) => { + // if (t) { + // } + // if (modifySuccessSubscription$) { + // modifySuccessSubscription$.unsubscribe(); + // } + // }, + // (error: RPCClientError) => { + // console.log(error); + // } + // ); } onDisplayNameChangeKeypress(event, value) { diff --git a/@overflow/target/component/index.ts b/@overflow/target/component/index.ts index 9e79653..1597ea7 100644 --- a/@overflow/target/component/index.ts +++ b/@overflow/target/component/index.ts @@ -1,9 +1,9 @@ import { DetailComponent } from './detail/detail.component'; import { ListComponent } from './list/list.component'; -import { FilterComponent } from './list/filter/filter.component'; +// import { FilterComponent } from './list/filter/filter.component'; export const COMPONENTS = [ ListComponent, - DetailComponent, - FilterComponent + // DetailComponent, + // FilterComponent ]; diff --git a/@overflow/target/component/list/list.component.html b/@overflow/target/component/list/list.component.html index 494405b..383ecca 100644 --- a/@overflow/target/component/list/list.component.html +++ b/@overflow/target/component/list/list.component.html @@ -32,3 +32,4 @@ +sdfsdfsdf diff --git a/@overflow/target/component/list/list.component.ts b/@overflow/target/component/list/list.component.ts index bbb89ee..90ced88 100644 --- a/@overflow/target/component/list/list.component.ts +++ b/@overflow/target/component/list/list.component.ts @@ -1,17 +1,11 @@ import { Component, OnInit, AfterContentInit, OnDestroy } from '@angular/core'; -import { Observable, of, Subscription } from 'rxjs'; -import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; - import { Router, ActivatedRoute } from '@angular/router'; import { Infra } from '@overflow/commons-typescript/model/infra'; -import { Store, select } from '@ngrx/store'; -// import { Page, PageParams } from 'app/commons/model'; -import { RPCClientError } from '@loafer/ng-rpc'; import { Probe } from '@overflow/commons-typescript/model/probe'; - import { Target } from '@overflow/commons-typescript/model/target'; - +import { Observable, of, Subscription } from 'rxjs'; +import { Store, select } from '@ngrx/store'; @Component({ selector: 'of-target-list', @@ -19,21 +13,21 @@ import { Target } from '@overflow/commons-typescript/model/target'; }) export class ListComponent implements OnInit, AfterContentInit, OnDestroy { - infrasSubscription$: Subscription; - infras$: Observable; - infras: Infra[]; - probe: Probe; - target: Target = null; - sensorSettingDisplay = false; + // infrasSubscription$: Subscription; + // infras$: Observable; + // infras: Infra[]; + // probe: Probe; + // target: Target = null; + // sensorSettingDisplay = false; pageSize = '10'; totalLength = 0; currPage = 0; constructor( - private route: ActivatedRoute, - private router: Router, - private store: Store, + // private route: ActivatedRoute, + // private router: Router, + // private store: Store, ) { } @@ -50,21 +44,22 @@ export class ListComponent implements OnInit, AfterContentInit, OnDestroy { // console.log(error); // } // ); + console.log('ddddddddddddddddddddd'); } ngAfterContentInit() { - this.route.params.subscribe((params: any) => { - this.probe = { - id: params['id'], - }; - this.getInfras(0); - }); + // this.route.params.subscribe((params: any) => { + // this.probe = { + // id: params['id'], + // }; + // this.getInfras(0); + // }); } ngOnDestroy() { - if (this.infrasSubscription$) { - this.infrasSubscription$.unsubscribe(); - } + // if (this.infrasSubscription$) { + // this.infrasSubscription$.unsubscribe(); + // } } getInfras(pageNo) { @@ -83,20 +78,20 @@ export class ListComponent implements OnInit, AfterContentInit, OnDestroy { onRowSelect(event) { // this.router.navigate(['target'], { queryParams: { target: event.data.id } }); - this.router.navigate(['target', event.data.id, 'info']); + // this.router.navigate(['target', event.data.id, 'info']); } onAddSensor(target: Target) { - this.target = target; - this.sensorSettingDisplay = true; + // this.target = target; + // this.sensorSettingDisplay = true; } onSensorSettingClose() { - this.sensorSettingDisplay = false; + // this.sensorSettingDisplay = false; } onPaging(e) { - this.getInfras(e.page); + // this.getInfras(e.page); } } diff --git a/@overflow/target/service/index.ts b/@overflow/target/service/index.ts index cd647e4..f62c62a 100644 --- a/@overflow/target/service/index.ts +++ b/@overflow/target/service/index.ts @@ -1,5 +1,5 @@ import { TargetService } from './target.service'; export const SERVICES = [ - TargetService, + // TargetService, ]; diff --git a/@overflow/target/service/target.service.ts b/@overflow/target/service/target.service.ts index 13424cd..09e9934 100644 --- a/@overflow/target/service/target.service.ts +++ b/@overflow/target/service/target.service.ts @@ -1,12 +1,11 @@ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; import { RPCService } from '@loafer/ng-rpc'; +import { Observable } from 'rxjs'; import { Target } from '@overflow/commons-typescript/model/target'; import { Host, Service } from '@overflow/commons-typescript/model/discovery'; - @Injectable() export class TargetService { @@ -21,7 +20,7 @@ export class TargetService { } public modify(target: Target): Observable { - return this.rpcService.call('TargetService.modify', target); + return this.rpcService.call('TargetService.modify', target); } } diff --git a/@overflow/target/target.module.ts b/@overflow/target/target.module.ts index faf8cfd..02330eb 100644 --- a/@overflow/target/target.module.ts +++ b/@overflow/target/target.module.ts @@ -11,9 +11,9 @@ import { InfraModule } from '../infra/infra.module'; @NgModule({ imports: [ CommonModule, - SensorModule, + // SensorModule, UIModule, - InfraModule + // InfraModule ], declarations: [ COMPONENTS, diff --git a/src/app/pages/probes/probe-tab-page-routing.module.ts b/src/app/pages/probes/probe-tab-page-routing.module.ts index 3d652ff..9da7457 100644 --- a/src/app/pages/probes/probe-tab-page-routing.module.ts +++ b/src/app/pages/probes/probe-tab-page-routing.module.ts @@ -4,7 +4,7 @@ import { ProbeTabPageComponent } from './probe-tab-page.component'; import { ProbeListPageComponent } from '@app/pages/probes/probe/probe-list-page.component'; import { ProbeDetailPageComponent } from '@app/pages/probes/probe/probe-detail-page.component'; import { NoAuthProbePageComponent } from '@app/pages/probes/noauth-probe/noauth-probe-page.component'; -import { ProbeDownloadPageComponent } from '../../pages/probes/download/download-page.component'; +import { ProbeDownloadPageComponent } from '@app/pages/probes/download/download-page.component'; const routes: Routes = [ { @@ -16,7 +16,7 @@ const routes: Routes = [ { path: 'download', component: ProbeDownloadPageComponent }, { path: 'download/:idx', component: ProbeDownloadPageComponent }, { path: ':id/info', component: ProbeDetailPageComponent }, - { path: ':id/target', loadChildren: '../../pages/targets/target-page.module#TargetPageModule' }, + { path: ':id/target', loadChildren: '@app/pages/targets/target-page.module#TargetPageModule' }, { path: ':id/history', component: null }, ] }, diff --git a/src/app/pages/targets/target-detail-page.component.ts b/src/app/pages/targets/target-detail-page.component.ts index c151c66..21f87c9 100644 --- a/src/app/pages/targets/target-detail-page.component.ts +++ b/src/app/pages/targets/target-detail-page.component.ts @@ -2,12 +2,12 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; @Component({ - selector: 'of-target-detail-page', + selector: 'of-pages-target-detail', templateUrl: './target-detail-page.component.html', }) export class TargetDetailPageComponent implements OnInit { - probeHostID: number; + // probeHostID: number; constructor( private route: ActivatedRoute diff --git a/src/app/pages/targets/target-list-page.component.html b/src/app/pages/targets/target-list-page.component.html index fb1f644..d4f229a 100644 --- a/src/app/pages/targets/target-list-page.component.html +++ b/src/app/pages/targets/target-list-page.component.html @@ -2,7 +2,7 @@
- sdjklfhjsklfjhlksdjfklsdhfjoliwejiolf +
diff --git a/src/app/pages/targets/target-list-page.component.ts b/src/app/pages/targets/target-list-page.component.ts index a8721a6..11cd8f6 100644 --- a/src/app/pages/targets/target-list-page.component.ts +++ b/src/app/pages/targets/target-list-page.component.ts @@ -1,13 +1,13 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, Input, OnInit} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; @Component({ - selector: 'of-target-list-page', + selector: 'of-pages-target-list', templateUrl: './target-list-page.component.html', }) export class TargetListPageComponent implements OnInit { - probeHostID: number; + // @Input() probeHostID: string; constructor( private route: ActivatedRoute diff --git a/src/app/pages/targets/target-page.component.html b/src/app/pages/targets/target-page.component.html index 3e276c0..029349b 100644 --- a/src/app/pages/targets/target-page.component.html +++ b/src/app/pages/targets/target-page.component.html @@ -1,11 +1,10 @@
- - -
- sdfsdf - + + + +
diff --git a/src/app/pages/targets/target-page.component.ts b/src/app/pages/targets/target-page.component.ts index 3705365..349d853 100644 --- a/src/app/pages/targets/target-page.component.ts +++ b/src/app/pages/targets/target-page.component.ts @@ -1,25 +1,23 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BreadcrumbService} from '../../commons/service/breadcrumb.service'; @Component({ selector: 'of-pages-target', templateUrl: './target-page.component.html', }) export class TargetPageComponent implements OnInit { + // probeHostID: string; - // tabs = undefined; - - constructor(private router: Router) { + constructor( + private router: Router, + private activatedRoute: ActivatedRoute, + ) { + // this.probeHostID = this.activatedRoute.snapshot.params['id']; } ngOnInit() { - - // const id = this.router.url.split('target/')[1].split('/')[0]; - // - // this.tabs = [ - // { label: 'INFO', routerLink: ['/target/', id, 'info'] }, - // { label: 'HISTORY', path: ['/target/', id, 'history'], disabled: true }, - // ]; - + // this.probeID = this.activatedRoute.snapshot.queryParams['probeID']; + // console.log(this.probeID); } } diff --git a/src/app/pages/targets/target-page.module.ts b/src/app/pages/targets/target-page.module.ts index 5f5da4b..ccedc2e 100644 --- a/src/app/pages/targets/target-page.module.ts +++ b/src/app/pages/targets/target-page.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { UIModule } from '@overflow/shared/ui/ui.module'; -// import { TargetModule } from '@overflow/target/target.module'; +import { TargetModule } from '@overflow/target/target.module'; import { TargetListPageComponent } from './target-list-page.component'; import { TargetDetailPageComponent } from './target-detail-page.component';