added discovery
This commit is contained in:
parent
ea56cb6d21
commit
a66411663d
|
@ -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({
|
||||||
|
|
|
@ -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
|
||||||
|
|
11
src/packages/discovery/model/DiscoveryStartInfo.ts
Normal file
11
src/packages/discovery/model/DiscoveryStartInfo.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
export interface DiscoveryStartInfo {
|
||||||
|
startIp: string;
|
||||||
|
endIP: string;
|
||||||
|
excludeIp: string;
|
||||||
|
startPort: string;
|
||||||
|
endPort: string;
|
||||||
|
services: Array<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// export default DiscoveryStartInfo;
|
16
src/packages/discovery/model/Host.ts
Normal file
16
src/packages/discovery/model/Host.ts
Normal 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;
|
15
src/packages/discovery/model/Port.ts
Normal file
15
src/packages/discovery/model/Port.ts
Normal 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;
|
10
src/packages/discovery/model/PortType.ts
Normal file
10
src/packages/discovery/model/PortType.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
// enum PortType {
|
||||||
|
// TCP = 1,
|
||||||
|
// UDP = 2,
|
||||||
|
// TLS = 3,
|
||||||
|
// }
|
||||||
|
|
||||||
|
type PortType = 'TCP' | 'UDP' | 'TLS';
|
||||||
|
|
||||||
|
export default PortType;
|
14
src/packages/discovery/model/Service.ts
Normal file
14
src/packages/discovery/model/Service.ts
Normal 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;
|
14
src/packages/discovery/model/Zone.ts
Normal file
14
src/packages/discovery/model/Zone.ts
Normal 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;
|
31
src/packages/discovery/service/discovery.service.ts
Normal file
31
src/packages/discovery/service/discovery.service.ts
Normal 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);
|
||||||
|
// }
|
||||||
|
}
|
0
src/packages/discovery/service/index.ts
Normal file
0
src/packages/discovery/service/index.ts
Normal file
Loading…
Reference in New Issue
Block a user