added discovery

This commit is contained in:
snoop 2018-03-07 14:55:14 +09:00
parent ea56cb6d21
commit a66411663d
11 changed files with 115 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {MatDialog} from '@angular/material'; import {MatDialog} from '@angular/material';
import { DiscoverySettingComponent } from 'packages/sensor/component/setting/setting.component'; import { SettingComponent as DiscoverySettingComponent } from 'packages/discovery/component/setting/setting.component';
@Component({ @Component({

View File

@ -7,7 +7,8 @@ import { MaterialModule } from 'app/commons/ui/material/material.module';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { DiscoverySettingComponent } from 'packages/sensor/component/setting/setting.component'; import { SettingComponent as DiscoverySettingComponent } from 'packages/discovery/component/setting/setting.component';
import { DiscoveryModule } from 'packages/discovery/discovery.module';
@ -18,6 +19,7 @@ import { DiscoverySettingComponent } from 'packages/sensor/component/setting/set
SensorSettingPageRoutingModule, SensorSettingPageRoutingModule,
SensorModule, SensorModule,
FormsModule, FormsModule,
DiscoveryModule
], ],
entryComponents: [ entryComponents: [
DiscoverySettingComponent DiscoverySettingComponent

View File

@ -0,0 +1,11 @@
export interface DiscoveryStartInfo {
startIp: string;
endIP: string;
excludeIp: string;
startPort: string;
endPort: string;
services: Array<string>;
}
// export default DiscoveryStartInfo;

View File

@ -0,0 +1,16 @@
import Port from './Port';
import Zone from './Zone';
interface Host {
id?: number;
ip: number;
mac: number;
createDate?: Date;
updateDate: Date;
os: string;
target: boolean;
ports?: Port[];
zone?: Zone;
}
export default Host;

View File

@ -0,0 +1,15 @@
import Host from './Host';
import Service from './Service';
import PortType from './PortType';
interface Port {
id?: number;
host: Host;
portType: PortType;
portNumber: number;
services?: Service[];
createDate?: Date;
updateDate: Date;
}
export default Port;

View File

@ -0,0 +1,10 @@
// enum PortType {
// TCP = 1,
// UDP = 2,
// TLS = 3,
// }
type PortType = 'TCP' | 'UDP' | 'TLS';
export default PortType;

View File

@ -0,0 +1,14 @@
import Port from './Port';
import PortType from './PortType';
interface Service {
id: number;
port: Port;
portType: PortType;
serviceName: string;
createDate: Date;
updateDate: Date;
target: boolean;
}
export default Service;

View File

@ -0,0 +1,14 @@
import Host from './Host';
export interface Zone {
id?: number;
network?: string;
ip?: string;
iface?: string;
mac?: string;
firstScanRange?: number;
lastScanRange?: number;
hosts?: Host[];
}
export default Zone;

View File

@ -0,0 +1,31 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { RESTService } from 'packages/commons/service/rest.service';
import { DiscoveryStartInfo } from '../model/DiscoveryStartInfo';
@Injectable()
export class DiscoveryService {
public constructor(
private restService: RESTService,
) {
}
public start(dsInfo: DiscoveryStartInfo): Observable<DiscoveryStartInfo> {
// const body = {
// signinId: email,
// signinPw: password,
// };
return this.restService.post('/discovery/start', dsInfo);
}
// public signup(member: DiscoveryStartInfo): Observable<DiscoveryStartInfo> {
// return this.restService.post('/account/signup', member);
// }
}

View File