Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6c41b5cbf2
20
src/app/commons/layouts/sub-menubar/sub-menubar.module.ts
Normal file
20
src/app/commons/layouts/sub-menubar/sub-menubar.module.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SubMenubarComponent } from 'app/commons/layouts/sub-menubar/sub-menubar.component';
|
||||
import { MaterialModule } from 'app/commons/ui/material/material.module';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
RouterModule,
|
||||
],
|
||||
declarations: [
|
||||
SubMenubarComponent,
|
||||
],
|
||||
exports: [
|
||||
SubMenubarComponent,
|
||||
]
|
||||
})
|
||||
export class SubMenubarModule { }
|
|
@ -1,3 +1,3 @@
|
|||
<p>
|
||||
detail works!
|
||||
{{probeId}} detail
|
||||
</p>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'of-detail',
|
||||
|
@ -7,9 +8,12 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class DetailComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
probeId = undefined;
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.probeId = this.route.snapshot.paramMap.get('id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core';
|
||||
import { MatTableDataSource, MatSort } from '@angular/material';
|
||||
import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
export interface Probe {
|
||||
id: string;
|
||||
|
@ -19,7 +20,7 @@ export interface Probe {
|
|||
templateUrl: './list.component.html',
|
||||
styleUrls: ['./list.component.scss']
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterContentInit {
|
||||
export class ListComponent implements OnInit, AfterContentInit {
|
||||
|
||||
displayedColumns = ['name', 'ip', 'os', 'cidr', 'targetCnt', 'date', 'authBy'];
|
||||
dataSource: MatTableDataSource<Probe>;
|
||||
|
@ -39,7 +40,7 @@ export class ListComponent implements OnInit, AfterContentInit {
|
|||
ip: String('ip' + i),
|
||||
os: String('os' + i),
|
||||
cidr: String('cidr' + i),
|
||||
targetCnt : i,
|
||||
targetCnt: i,
|
||||
date: String('date' + i),
|
||||
authBy: String('insanity')
|
||||
};
|
||||
|
@ -50,12 +51,12 @@ export class ListComponent implements OnInit, AfterContentInit {
|
|||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
constructor() { }
|
||||
constructor(private router: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
handleRowClick(obj: Probe) {
|
||||
alert(obj.id);
|
||||
this.router.navigate(['probe', obj.id]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ const routes: Routes = [
|
|||
children: [
|
||||
{ path: '', redirectTo: 'home' },
|
||||
{ path: 'home', loadChildren: './home/home-page.module#HomePageModule' },
|
||||
{ path: 'probe', loadChildren: './probes/probes-page.module#ProbesPageModule' },
|
||||
|
||||
{ path: 'probes', loadChildren: './probes/probes-page.module#ProbesPageModule' },
|
||||
{ path: 'probe', loadChildren: './probe/probe-page.module#ProbePageModule' },
|
||||
{ path: 'discovery', loadChildren: './discovery/discovery-page.module#DiscoveryPageModule' },
|
||||
{ path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' },
|
||||
]
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<of-header [sidenav]="sidenav" [drawer]="drawer" [sidebar]="sidenav2" [matDrawerShow]="matDrawerShow" style="z-index: 500"></of-header>
|
||||
|
||||
<perfect-scrollbar style="height: calc(100% - 33px);">
|
||||
<div style="height: 100%; padding: 0px 10px 0px 10px">
|
||||
<div style="height: 100%;">
|
||||
<router-outlet #route="outlet"></router-outlet>
|
||||
</div>
|
||||
</perfect-scrollbar>
|
||||
|
|
|
@ -28,7 +28,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
|||
CovalentModule,
|
||||
MaterialModule,
|
||||
PerfectScrollbarModule,
|
||||
FlexLayoutModule
|
||||
FlexLayoutModule,
|
||||
],
|
||||
declarations: [
|
||||
PagesComponent,
|
||||
|
|
22
src/app/pages/probe/probe-page-routing.module.ts
Normal file
22
src/app/pages/probe/probe-page-routing.module.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ProbePageComponent } from './probe-page.component';
|
||||
import { DetailComponent as ProbeDetailComponent } from 'app/packages/probe/component/detail/detail.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ProbePageComponent,
|
||||
children: [
|
||||
{ path: ':id', component: ProbeDetailComponent },
|
||||
{ path: ':id/target', component: ProbeDetailComponent },
|
||||
{ path: ':id/history', component: ProbeDetailComponent },
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class ProbesPageRoutingModule { }
|
6
src/app/pages/probe/probe-page.component.html
Normal file
6
src/app/pages/probe/probe-page.component.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div>
|
||||
<of-sub-menubar [tabs]="tabs"></of-sub-menubar>
|
||||
<div style="padding: 15px">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</div>
|
0
src/app/pages/probe/probe-page.component.scss
Normal file
0
src/app/pages/probe/probe-page.component.scss
Normal file
25
src/app/pages/probe/probe-page.component.spec.ts
Normal file
25
src/app/pages/probe/probe-page.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProbePageComponent } from './probe-page.component';
|
||||
|
||||
describe('ProbeComponent', () => {
|
||||
let component: ProbePageComponent;
|
||||
let fixture: ComponentFixture<ProbePageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ProbePageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProbePageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
24
src/app/pages/probe/probe-page.component.ts
Normal file
24
src/app/pages/probe/probe-page.component.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'of-pages-probe',
|
||||
templateUrl: './probe-page.component.html',
|
||||
styleUrls: ['./probe-page.component.scss']
|
||||
})
|
||||
export class ProbePageComponent implements OnInit {
|
||||
|
||||
tabs = undefined;
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.tabs = [
|
||||
{ label: 'Info', path: this.router.url },
|
||||
{ label: 'Targets', path: '/target' },
|
||||
{ label: 'History', path: '/probe/history' },
|
||||
];
|
||||
}
|
||||
|
||||
}
|
21
src/app/pages/probe/probe-page.module.ts
Normal file
21
src/app/pages/probe/probe-page.module.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ProbePageComponent } from './probe-page.component';
|
||||
import { ProbesPageRoutingModule } from './probe-page-routing.module';
|
||||
import { MaterialModule } from 'app/commons/ui/material/material.module';
|
||||
import { ProbeModule } from 'app/packages/probe/probe.module';
|
||||
import { SubMenubarModule } from 'app/commons/layouts/sub-menubar/sub-menubar.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
ProbesPageRoutingModule,
|
||||
MaterialModule,
|
||||
ProbeModule,
|
||||
SubMenubarModule
|
||||
],
|
||||
declarations: [
|
||||
ProbePageComponent,
|
||||
]
|
||||
})
|
||||
export class ProbePageModule { }
|
|
@ -12,7 +12,6 @@ const routes: Routes = [
|
|||
component: ProbesPageComponent,
|
||||
children: [
|
||||
{ path: '', component: ProbeListComponent },
|
||||
{ path: 'detail/:id', component: ProbeDetailComponent },
|
||||
{ path: 'noauth', component: NoauthListComponent },
|
||||
{ path: 'download', component: DownloadComponent },
|
||||
]
|
||||
|
|
|
@ -13,12 +13,6 @@ export class ProbesPageComponent {
|
|||
{ label: 'Download', path: '/probes/download' },
|
||||
];
|
||||
|
||||
// tabs2 = [
|
||||
// { label: 'Info', path: '/probe/' },
|
||||
// { label: 'Targets', path: '/target' },
|
||||
// { label: 'History', path: '/probe/history' },
|
||||
// ];
|
||||
|
||||
constructor() { }
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@ import { NgModule } from '@angular/core';
|
|||
import { CommonModule } from '@angular/common';
|
||||
import { ProbesPageComponent } from './probes-page.component';
|
||||
import { ProbesPageRoutingModule } from './probes-page-routing.module';
|
||||
import { SubMenubarComponent } from 'app/commons/layouts/sub-menubar/sub-menubar.component';
|
||||
import { MaterialModule } from 'app/commons/ui/material/material.module';
|
||||
import { ProbeModule } from 'app/packages/probe/probe.module';
|
||||
import { NoauthModule } from 'app/packages/noauth/noauth.module';
|
||||
import { SubMenubarModule } from 'app/commons/layouts/sub-menubar/sub-menubar.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -14,10 +14,10 @@ import { NoauthModule } from 'app/packages/noauth/noauth.module';
|
|||
MaterialModule,
|
||||
ProbeModule,
|
||||
NoauthModule,
|
||||
SubMenubarModule
|
||||
],
|
||||
declarations: [
|
||||
ProbesPageComponent,
|
||||
SubMenubarComponent
|
||||
]
|
||||
})
|
||||
export class ProbesPageModule { }
|
||||
|
|
Loading…
Reference in New Issue
Block a user