This commit is contained in:
geek 2018-06-05 18:32:20 +09:00
parent b5b874afe1
commit a415181e26
20 changed files with 85 additions and 112 deletions

View File

@ -61,9 +61,9 @@ export class DiscoveryComponent implements OnDestroy {
// TODO: fix
const zone: Zone = {
network: '192.168.1.0/24',
ipv4: '192.168.1.101',
ipv4: '192.168.1.103',
iface: 'enp3s0',
mac: '44:8a:5b:f1:f1:f3',
mac: '44:8a:5b:44:8c:e8',
hosts: null,
};
this.discoveryService.discoverHost(this.selectedProbe.probe.probeKey, zone, dz.discoverHost);

View File

@ -6,7 +6,7 @@ const routes: Routes = [
{ path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
{ path: 'error', loadChildren: './pages/error/error-page.module#ErrorPageModule' },
{ path: '**', redirectTo: 'error' },
// { path: '**', redirectTo: 'error' },
];
@NgModule({

View File

@ -13,6 +13,7 @@ const routes: Routes = [
{ path: 'discovery', loadChildren: './discovery/discovery-page.module#DiscoveryPageModule' },
{ path: 'map', loadChildren: './infra/infra-page.module#InfraPageModule' },
{ path: 'sensor', loadChildren: './sensors/sensor-tab-page.module#SensorTabPageModule' },
{ path: 'target', loadChildren: './target/target-page.module#TargetPageModule'},
// { path: 'target', loadChildren: './target/target-page.module#TargetPageModule' },
// { path: 'overview', loadChildren: './overview/overview-page.module#OverviewPageModule' },
// { path: 'dashboard', loadChildren: './dashboard/dashboard-page.module#DashboardPageModule' },

View File

@ -16,7 +16,6 @@ const routes: Routes = [
{ path: 'download', component: ProbeDownloadPageComponent },
{ path: 'download/:idx', component: ProbeDownloadPageComponent },
{ path: ':id/info', component: ProbeDetailPageComponent },
// { path: ':id/targets', loadChildren: 'app/pages/targets/targets-page.module#TargetsPageModule'},
{ path: ':id/history', component: null },
]
},

View File

@ -41,7 +41,8 @@ export class ProbeTabPageComponent implements OnDestroy {
default:
this.tabs = [
{ label: 'INFO', routerLink: ['/probe/', parsedUrl, 'info'] },
{ label: 'TARGETS', path: ['/probe/', parsedUrl, 'targets'], disabled: true },
// { label: 'TARGETS', path: ['/probe/', parsedUrl, 'target'] },
{ label: 'TARGETS', routerLink: ['/target/list'], queryParams: {probe: parsedUrl}},
{ label: 'HISTORY', path: ['/probe/', parsedUrl, 'history'], disabled: true },
];
break;

View File

@ -1,7 +1,5 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';

View File

@ -1,8 +1,6 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs';
import { Component } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';
@Component({

View File

@ -0,0 +1,9 @@
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<div class="card no-margin">
<of-discovery [probeHostID]="probeHostID"></of-discovery>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,18 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'of-target-detail-page',
templateUrl: './target-detail-page.component.html',
})
export class TargetDetailPageComponent implements OnInit {
probeHostID: number;
constructor(
private route: ActivatedRoute
) { }
ngOnInit() {
}
}

View File

@ -0,0 +1,9 @@
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<div class="card no-margin">
sdjklfhjsklfjhlksdjfklsdhfjoliwejiolf
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'of-target-list-page',
templateUrl: './target-list-page.component.html',
})
export class TargetListPageComponent implements OnInit {
probeHostID: number;
constructor(
private route: ActivatedRoute
) { }
ngOnInit() {
}
}

View File

@ -1,14 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TargetPageComponent } from './target-page.component';
import { DetailComponent as TargetDetailComponent } from '@overflow/target/component/detail/detail.component';
import { TargetListPageComponent } from './target-list-page.component';
import { TargetDetailPageComponent } from './target-detail-page.component';
const routes: Routes = [
{
path: '',
component: TargetPageComponent,
children: [
{ path: ':id/info', component: TargetDetailComponent }
{ path: 'list', component: TargetListPageComponent },
{ path: 'detail', component: TargetDetailPageComponent }
]
}
];

View File

@ -1,10 +1,11 @@
<div class="ui-g">
<div class="ui-g-12">
<!--<div class="card no-margin">-->
<!--<of-tabbar [tabs]="tabs"></of-tabbar>-->
<!--</div>-->
<div class="card no-margin">
<of-tabbar [tabs]="tabs"></of-tabbar>
</div>
<div class="card no-margin">
sdfsdf
<router-outlet></router-outlet>
</div>
</div>
</div>
</div>

View File

@ -7,19 +7,19 @@ import { Router } from '@angular/router';
})
export class TargetPageComponent implements OnInit {
tabs = undefined;
// tabs = undefined;
constructor(private router: Router) {
}
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 },
];
// 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 },
// ];
}
}

View File

@ -4,9 +4,9 @@ import { CommonModule } from '@angular/common';
import { UIModule } from '@overflow/shared/ui/ui.module';
import { TargetModule } from '@overflow/target/target.module';
import { TargetListPageComponent } from './target-list-page.component';
import { TargetDetailPageComponent } from './target-detail-page.component';
import { TargetPageRoutingModule } from './target-page-routing.module';
import { TargetPageComponent } from './target-page.component';
import { TabbarModule } from '../../commons/component/layout/tabbar/app.tabbar.module';
@NgModule({
imports: [
@ -14,10 +14,11 @@ import { TabbarModule } from '../../commons/component/layout/tabbar/app.tabbar.m
UIModule,
TargetPageRoutingModule,
TargetModule,
TabbarModule
// TabbarModule
],
declarations: [
TargetPageComponent
TargetListPageComponent,
TargetDetailPageComponent,
]
})
export class TargetPageModule { }

View File

@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TargetsPageComponent } from './targets-page.component';
const routes: Routes = [
{
path: '',
component: TargetsPageComponent,
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class TargetsPageRoutingModule { }

View File

@ -1,7 +0,0 @@
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<of-target-list></of-target-list>
</div>
</div>
</div>

View File

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TargetsPageComponent } from './targets-page.component';
describe('TargetsComponent', () => {
let component: TargetsPageComponent;
let fixture: ComponentFixture<TargetsPageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TargetsPageComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TargetsPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,14 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'of-pages-targets',
templateUrl: './targets-page.component.html',
})
export class TargetsPageComponent implements OnInit {
constructor() {
}
ngOnInit() {
}
}

View File

@ -1,21 +0,0 @@
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 { TargetsPageRoutingModule } from './targets-page-routing.module';
import { TargetsPageComponent } from './targets-page.component';
@NgModule({
imports: [
CommonModule,
UIModule,
TargetsPageRoutingModule,
TargetModule,
],
declarations: [
TargetsPageComponent
]
})
export class TargetsPageModule { }