From eebad1443a0d656f8cbf4cbab371e1bc713235bd Mon Sep 17 00:00:00 2001 From: insanity Date: Wed, 31 Jan 2018 14:25:45 +0900 Subject: [PATCH] test --- .../commons/layouts/sidebar/menu-element.ts | 2 +- .../sub-menubar/sub-menubar.component.ts | 8 ++---- .../component/detail/detail.component.html | 3 +++ .../component/detail/detail.component.scss | 0 .../component/detail/detail.component.spec.ts | 25 +++++++++++++++++++ .../component/detail/detail.component.ts | 15 +++++++++++ src/app/packages/probe/probe.module.ts | 4 ++- src/app/pages/pages-routing.module.ts | 2 +- src/app/pages/pages.component.html | 2 +- .../probes/probes-page-routing.module.ts | 2 ++ .../pages/probes/probes-page.component.html | 2 +- src/app/pages/probes/probes-page.component.ts | 18 ++++++++++--- 12 files changed, 68 insertions(+), 15 deletions(-) create mode 100644 src/app/packages/probe/component/detail/detail.component.html create mode 100644 src/app/packages/probe/component/detail/detail.component.scss create mode 100644 src/app/packages/probe/component/detail/detail.component.spec.ts create mode 100644 src/app/packages/probe/component/detail/detail.component.ts diff --git a/src/app/commons/layouts/sidebar/menu-element.ts b/src/app/commons/layouts/sidebar/menu-element.ts index ed19fb3..80bc679 100644 --- a/src/app/commons/layouts/sidebar/menu-element.ts +++ b/src/app/commons/layouts/sidebar/menu-element.ts @@ -27,7 +27,7 @@ export const menus = [ }, { 'name': 'Probes', - 'link': '/probes', + 'link': '/probe', 'icon': 'indeterminate_check_box', 'chip': false, 'open': false, diff --git a/src/app/commons/layouts/sub-menubar/sub-menubar.component.ts b/src/app/commons/layouts/sub-menubar/sub-menubar.component.ts index f38dfa9..c8a3e0e 100644 --- a/src/app/commons/layouts/sub-menubar/sub-menubar.component.ts +++ b/src/app/commons/layouts/sub-menubar/sub-menubar.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; import { Router } from '@angular/router'; @Component({ @@ -8,11 +8,7 @@ import { Router } from '@angular/router'; }) export class SubMenubarComponent implements OnInit { - tabs = [ - {label: 'Probe', path: '/probes'}, - {label: 'Unauthorized', path: '/probes/noauth'}, - {label: 'Download', path: '/probes/download'}, - ]; + @Input() tabs: any; constructor(public router: Router) { } diff --git a/src/app/packages/probe/component/detail/detail.component.html b/src/app/packages/probe/component/detail/detail.component.html new file mode 100644 index 0000000..6f936ed --- /dev/null +++ b/src/app/packages/probe/component/detail/detail.component.html @@ -0,0 +1,3 @@ +

+ detail works! +

diff --git a/src/app/packages/probe/component/detail/detail.component.scss b/src/app/packages/probe/component/detail/detail.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/packages/probe/component/detail/detail.component.spec.ts b/src/app/packages/probe/component/detail/detail.component.spec.ts new file mode 100644 index 0000000..149b9be --- /dev/null +++ b/src/app/packages/probe/component/detail/detail.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DetailComponent } from './detail.component'; + +describe('DetailComponent', () => { + let component: DetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/packages/probe/component/detail/detail.component.ts b/src/app/packages/probe/component/detail/detail.component.ts new file mode 100644 index 0000000..c7b90c6 --- /dev/null +++ b/src/app/packages/probe/component/detail/detail.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'of-detail', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.scss'] +}) +export class DetailComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/packages/probe/probe.module.ts b/src/app/packages/probe/probe.module.ts index 33a5ced..4d97b08 100644 --- a/src/app/packages/probe/probe.module.ts +++ b/src/app/packages/probe/probe.module.ts @@ -3,6 +3,7 @@ import { CommonModule } from '@angular/common'; import { ListComponent } from 'app/packages/probe/component/list/list.component'; import { DownloadComponent } from 'app/packages/probe/component/download/download.component'; import { MaterialModule } from 'app/commons/ui/material/material.module'; +import { DetailComponent } from 'app/packages/probe/component/detail/detail.component'; @NgModule({ imports: [ @@ -11,7 +12,8 @@ import { MaterialModule } from 'app/commons/ui/material/material.module'; ], declarations: [ ListComponent, - DownloadComponent + DownloadComponent, + DetailComponent ], }) export class ProbeModule { } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index 88ec4fc..8d98aa4 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -9,7 +9,7 @@ const routes: Routes = [ children: [ { path: '', redirectTo: 'home' }, { path: 'home', loadChildren: './home/home-page.module#HomePageModule' }, - { path: 'probes', loadChildren: './probes/probes-page.module#ProbesPageModule' }, + { path: 'probe', loadChildren: './probes/probes-page.module#ProbesPageModule' }, { path: 'discovery', loadChildren: './discovery/discovery-page.module#DiscoveryPageModule' }, { path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' }, diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html index 783ac93..05b90c1 100644 --- a/src/app/pages/pages.component.html +++ b/src/app/pages/pages.component.html @@ -26,7 +26,7 @@ -
+
diff --git a/src/app/pages/probes/probes-page-routing.module.ts b/src/app/pages/probes/probes-page-routing.module.ts index 02fc95f..f2583f7 100644 --- a/src/app/pages/probes/probes-page-routing.module.ts +++ b/src/app/pages/probes/probes-page-routing.module.ts @@ -4,6 +4,7 @@ import { ProbesPageComponent } from './probes-page.component'; import { ListComponent as ProbeListComponent } from 'app/packages/probe/component/list/list.component'; import { ListComponent as NoauthListComponent } from 'app/packages/noauth/component/list/list.component'; import { DownloadComponent } from 'app/packages/probe/component/download/download.component'; +import { DetailComponent as ProbeDetailComponent } from 'app/packages/probe/component/detail/detail.component'; const routes: Routes = [ { @@ -11,6 +12,7 @@ const routes: Routes = [ component: ProbesPageComponent, children: [ { path: '', component: ProbeListComponent }, + { path: 'detail/:id', component: ProbeDetailComponent }, { 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 f50f543..93fb5f1 100644 --- a/src/app/pages/probes/probes-page.component.html +++ b/src/app/pages/probes/probes-page.component.html @@ -1,4 +1,4 @@
- +
\ No newline at end of file diff --git a/src/app/pages/probes/probes-page.component.ts b/src/app/pages/probes/probes-page.component.ts index 4c0b500..87acd15 100644 --- a/src/app/pages/probes/probes-page.component.ts +++ b/src/app/pages/probes/probes-page.component.ts @@ -1,15 +1,25 @@ import { Component, OnInit } from '@angular/core'; +import { Router, Route } from '@angular/router'; @Component({ selector: 'of-pages-probes', templateUrl: './probes-page.component.html', styleUrls: ['./probes-page.component.scss'] }) -export class ProbesPageComponent implements OnInit { +export class ProbesPageComponent { - constructor() { } + tabs = [ + { label: 'Probe', path: '/probe' }, + { label: 'Unauthorized', path: '/probe/noauth' }, + { label: 'Download', path: '/probe/download' }, + ]; - ngOnInit() { - } + // tabs2 = [ + // { label: 'Info', path: '/probe/' }, + // { label: 'Targets', path: '/target' }, + // { label: 'History', path: '/probe/history' }, + // ]; + + constructor(private router: Router) { } }