From 5aed772c549fb83ad4f70728b754ed44d0d7ca2d Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 9 Apr 2018 20:03:15 +0900 Subject: [PATCH] login --- src/app/pages/probe/probe-page.component.html | 4 +- .../probes/probes-page-routing.module.ts | 4 +- .../pages/probes/probes-page.component.html | 8 -- src/app/pages/probes/probes-page.module.ts | 4 +- .../component/signin/signin.component.html | 63 +++++++++------- .../probe/component/list/list.component.html | 73 +++++++------------ .../probe/component/list/list.component.ts | 67 ++++++++--------- src/packages/probe/probe.module.ts | 2 + 8 files changed, 98 insertions(+), 127 deletions(-) diff --git a/src/app/pages/probe/probe-page.component.html b/src/app/pages/probe/probe-page.component.html index a21e96a..7dfee1f 100644 --- a/src/app/pages/probe/probe-page.component.html +++ b/src/app/pages/probe/probe-page.component.html @@ -1,3 +1 @@ -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/src/app/pages/probes/probes-page-routing.module.ts b/src/app/pages/probes/probes-page-routing.module.ts index 39e61ec..6b41277 100644 --- a/src/app/pages/probes/probes-page-routing.module.ts +++ b/src/app/pages/probes/probes-page-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { ProbesPageComponent } from './probes-page.component'; -// import { ListComponent as ProbeListComponent } from 'packages/probe/component/list/list.component'; +import { ListComponent as ProbeListComponent } from 'packages/probe/component/list/list.component'; // import { ListComponent as NoauthListComponent } from 'packages/noauth/component/list/list.component'; // import { DownloadComponent } from 'packages/probe/component/download/download.component'; // import { DetailComponent as ProbeDetailComponent } from 'packages/probe/component/detail/detail.component'; @@ -11,7 +11,7 @@ const routes: Routes = [ path: '', component: ProbesPageComponent, children: [ - // { path: '', component: ProbeListComponent }, + { path: '', component: ProbeListComponent }, // { path: 'noauth', component: NoauthListComponent }, // { path: 'download', component: DownloadComponent }, ] diff --git a/src/app/pages/probes/probes-page.component.html b/src/app/pages/probes/probes-page.component.html index cc15cd0..7120181 100644 --- a/src/app/pages/probes/probes-page.component.html +++ b/src/app/pages/probes/probes-page.component.html @@ -1,9 +1 @@ - - probe detail \ No newline at end of file diff --git a/src/app/pages/probes/probes-page.module.ts b/src/app/pages/probes/probes-page.module.ts index c5c0239..9453cdb 100644 --- a/src/app/pages/probes/probes-page.module.ts +++ b/src/app/pages/probes/probes-page.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -// import { ProbeModule } from 'packages/probe/probe.module'; +import { ProbeModule } from 'packages/probe/probe.module'; // import { NoauthModule } from 'packages/noauth/noauth.module'; import { ProbesPageComponent } from './probes-page.component'; import { ProbesPageRoutingModule } from './probes-page-routing.module'; @@ -9,7 +9,7 @@ import { ProbesPageRoutingModule } from './probes-page-routing.module'; imports: [ CommonModule, ProbesPageRoutingModule, - // ProbeModule, + ProbeModule, // NoauthModule, ], declarations: [ diff --git a/src/packages/member/component/signin/signin.component.html b/src/packages/member/component/signin/signin.component.html index fe3cfc7..842018b 100644 --- a/src/packages/member/component/signin/signin.component.html +++ b/src/packages/member/component/signin/signin.component.html @@ -1,30 +1,37 @@ -
-
-
- -
-
- - - - -
-
- - - - -
-
- - +
+ - -
\ No newline at end of file + \ No newline at end of file diff --git a/src/packages/probe/component/list/list.component.html b/src/packages/probe/component/list/list.component.html index 4989ba1..dcceac7 100644 --- a/src/packages/probe/component/list/list.component.html +++ b/src/packages/probe/component/list/list.component.html @@ -1,46 +1,27 @@ -
probe list
- \ No newline at end of file + + + + Recent Sales + + + Probe Name + IP + OS + CIDR + Targets + Authroized at + Authroized by + + + + + {{probe.displayName}} + ? + ? + {{probe.cidr}} + ?? + {{probe.authorizeDate}} + {{probe.authorizeMember.name}} + + + \ No newline at end of file diff --git a/src/packages/probe/component/list/list.component.ts b/src/packages/probe/component/list/list.component.ts index 1e831f0..3ed92f2 100644 --- a/src/packages/probe/component/list/list.component.ts +++ b/src/packages/probe/component/list/list.component.ts @@ -18,12 +18,8 @@ import { ListSelector } from '../../store'; }) export class ListComponent implements OnInit, AfterContentInit { probes$ = this.store.pipe(select(ListSelector.select('probes'))); - // pageSize = '25'; - // length = '100'; - - displayedColumns = ['name', 'ip', 'os', 'cidr', 'targetCnt', 'date', 'authBy']; -// dataSource: MatTableDataSource; -// @ViewChild(MatSort) sort: MatSort; + probes: Probe[]; + cols: any[]; constructor( private router: Router, @@ -45,48 +41,43 @@ export class ListComponent implements OnInit, AfterContentInit { this.probes$.subscribe( (probes: Probe[]) => { console.log(probes); - // this.dataSource = new MatTableDataSource(probes); - // this.dataSource.sort = this.sort; }, (error: RPCClientError) => { console.log(error.response.message); } ); - // // temporary data - // const data: Probe[] = new Array(); - // for (let i = 0; i < 100; i++) { - // const p: Probe = { - // id: i, - // displayName: String('displayName' + i), - // host: { - // ip: i, - // os: { - // meta: 'blahblahblah' - // }, - // }, - // cidr: String('cidr' + i), - // targets: [ - // { - // id: i, - // }, - // ], - // authorizeDate: new Date(), - // authorizeMember: { - // 'name': String('insanity') - // }, - // }; - // data.push(p); - // } - - // this.dataSource = new MatTableDataSource(data); - // this.dataSource.sort = this.sort; } ngOnInit() { + this.cols = [ + { field: 'displayName', header: 'displayName' }, + { field: 'createDate', header: 'createDate' }, + { field: 'cidr', header: 'CIDR' }, + { field: 'authorizeDate', header: 'authorizeDate' }, + { field: 'authorizeMember', authorizeMember: 'Color' } + ]; + + // Temporary data + this.probes = new Array(); + for (let i = 0; i < 10; i++) { + const p: Probe = { + id: i, + createDate: new Date(), + description: 'Description' + i, + displayName: 'DisplayName' + i, + cidr: 'CIDR' + i, + authorizeDate: new Date(), + authorizeMember: { + name: 'MemberName' + i, + }, + }; + this.probes.push(p); + } } - handleRowClick(obj: Probe) { - this.router.navigate(['probe', obj.id]); + onRowSelect(event) { + console.log(event.data); + // this.router.navigate(['probe', obj.id]); } } diff --git a/src/packages/probe/probe.module.ts b/src/packages/probe/probe.module.ts index 7bcae30..24a789f 100644 --- a/src/packages/probe/probe.module.ts +++ b/src/packages/probe/probe.module.ts @@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common'; import { COMPONENTS } from './component'; import { ProbeStoreModule } from './probe-store.module'; import { SERVICES } from './service'; +import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module'; // import { SettingComponent as DiscoverySettingComponent } from 'packages/discovery/component/setting/setting.component'; // import { DiscoveryModule } from '../discovery/discovery.module'; @@ -11,6 +12,7 @@ import { SERVICES } from './service'; @NgModule({ imports: [ CommonModule, + PrimeNGModules, ProbeStoreModule, // DiscoveryModule ],