diff --git a/@overflow/discovery/component/discovery-infra-tree.component.ts b/@overflow/discovery/component/discovery-infra-tree.component.ts index 2b17445..5fdcac7 100644 --- a/@overflow/discovery/component/discovery-infra-tree.component.ts +++ b/@overflow/discovery/component/discovery-infra-tree.component.ts @@ -9,7 +9,7 @@ import { TreeNode, Message } from 'primeng/primeng'; import { ProbeHost } from '@overflow/commons-typescript/model/probe'; import { Anim } from './animation'; import { TargetService } from '@overflow/target/service/target.service'; -import { InfraService, InfraHost, Infra, MetaInfraTypeEnum, toMetaInfraType, InfraZone, Target, Page, PageParams } from '@overflow/commons-typescript'; +import { InfraService, InfraHost, Infra, MetaInfraTypeEnum, toMetaInfraType, InfraZone, Target, Page, PageParams, InfraHostIP } from '@overflow/commons-typescript'; import { InfraService as InfraManageService } from '../../infra/service/infra.service'; import { Observable, of } from 'rxjs'; import { catchError, map, tap, take } from 'rxjs/operators'; @@ -146,6 +146,9 @@ export class DiscoveryInfraTreeComponent implements OnChanges { } addInfraHost(infraHost: InfraHost) { + if (infraHost.infraHostIPs[0].address.indexOf('/') >= 0) { + return; + } const target: Target = this.checkAlreadyTarget(infraHost.id); const ip = infraHost.infraHostIPs[0].address; const idx = this.findHostIndex(ip); @@ -199,6 +202,8 @@ export class DiscoveryInfraTreeComponent implements OnChanges { } saveDiscoveredInfras() { + console.log(this.discoveredHosts); + console.log(this.discoveredServices); this.infraManageService.registDiscoverd( this.probeHost.probe.id, this.discoveredHosts, @@ -261,9 +266,10 @@ export class DiscoveryInfraTreeComponent implements OnChanges { addService(service: Service) { let exist = false; this.infraServices.forEach(infraService => { - if (infraService.metaTargetServiceType.name === service.key && + if (infraService.metaTargetServiceType.key === service.key && infraService.infraHostPort.port === service.port.portNumber && - infraService.infraHostPort.infraHostIP.address === service.port.host.address + infraService.infraHostPort.infraHostIP.address === service.port.host.address && + infraService.infraHostPort.metaPortType.key === service.port.metaPortType.key ) { exist = true; return; @@ -368,9 +374,10 @@ export class DiscoveryInfraTreeComponent implements OnChanges { } else if (infra.metaInfraType.key === toMetaInfraType(MetaInfraTypeEnum.SERVICE).key) { const infraService: InfraService = infra; const service: Service = node.data.object; - if (infraService.metaTargetServiceType.name === service.name && + if (infraService.metaTargetServiceType.key === service.key && infraService.infraHostPort.infraHostIP.address === service.port.host.address && - infraService.infraHostPort.port === service.port.portNumber + infraService.infraHostPort.port === service.port.portNumber && + infraService.infraHostPort.metaPortType.key === service.port.metaPortType.key ) { infraID = infraService.id; } @@ -392,6 +399,8 @@ export class DiscoveryInfraTreeComponent implements OnChanges { targets.push(target); }); + console.log(targets); + this.targetService.registAll(targets, this.probeHost.probe.id) .pipe( tap(() => { diff --git a/@overflow/discovery/component/search-filter.component.html b/@overflow/discovery/component/search-filter.component.html index 6bb102a..668274c 100644 --- a/@overflow/discovery/component/search-filter.component.html +++ b/@overflow/discovery/component/search-filter.component.html @@ -3,8 +3,8 @@