ing
This commit is contained in:
parent
be995c40bc
commit
09f98c885c
|
@ -147,7 +147,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
|
||||||
|
|
||||||
addInfraHost(infraHost: InfraHost) {
|
addInfraHost(infraHost: InfraHost) {
|
||||||
const target: Target = this.checkAlreadyTarget(infraHost.id);
|
const target: Target = this.checkAlreadyTarget(infraHost.id);
|
||||||
const ip = infraHost.infraHostIPs[0].address
|
const ip = infraHost.infraHostIPs[0].address;
|
||||||
const idx = this.findHostIndex(ip);
|
const idx = this.findHostIndex(ip);
|
||||||
this.hostNode.splice(idx, 0, {
|
this.hostNode.splice(idx, 0, {
|
||||||
type: 'HOST',
|
type: 'HOST',
|
||||||
|
@ -261,7 +261,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
|
||||||
addService(service: Service) {
|
addService(service: Service) {
|
||||||
let exist = false;
|
let exist = false;
|
||||||
this.infraServices.forEach(infraService => {
|
this.infraServices.forEach(infraService => {
|
||||||
if (infraService.metaTargetServiceType.name === service.name &&
|
if (infraService.metaTargetServiceType.name === service.key &&
|
||||||
infraService.infraHostPort.port === service.port.portNumber &&
|
infraService.infraHostPort.port === service.port.portNumber &&
|
||||||
infraService.infraHostPort.infraHostIP.address === service.port.host.address
|
infraService.infraHostPort.infraHostIP.address === service.port.host.address
|
||||||
) {
|
) {
|
||||||
|
@ -274,10 +274,10 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetHostNode = this.findHostNodeByService(service.port.host.address);
|
const targetHostNode = this.findHostNodeByService(service.port.host.address);
|
||||||
const idx = this.findServiceIndex(targetHostNode.children, service.name);
|
const idx = this.findServiceIndex(targetHostNode.children, service.key);
|
||||||
targetHostNode.children.splice(idx, 0, {
|
targetHostNode.children.splice(idx, 0, {
|
||||||
type: 'SERVICE',
|
type: 'SERVICE',
|
||||||
label: service.name + ' (' + service.port.portNumber + ')',
|
label: service.key + ' (' + service.port.portNumber + ')',
|
||||||
data: {
|
data: {
|
||||||
target: null,
|
target: null,
|
||||||
date: null,
|
date: null,
|
||||||
|
@ -285,7 +285,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
|
||||||
portNumber: service.port.portNumber,
|
portNumber: service.port.portNumber,
|
||||||
object: service,
|
object: service,
|
||||||
InfraID: null,
|
InfraID: null,
|
||||||
name: service.name
|
name: service.key
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
|
||||||
} else if (infra.metaInfraType.key === toMetaInfraType(MetaInfraTypeEnum.SERVICE).key) {
|
} else if (infra.metaInfraType.key === toMetaInfraType(MetaInfraTypeEnum.SERVICE).key) {
|
||||||
const infraService: InfraService = infra;
|
const infraService: InfraService = infra;
|
||||||
const service: Service = node.data.object;
|
const service: Service = node.data.object;
|
||||||
if (infraService.metaTargetServiceType.name === service.name &&
|
if (infraService.metaTargetServiceType.name === service.key &&
|
||||||
infraService.infraHostPort.infraHostIP.address === service.port.host.address) {
|
infraService.infraHostPort.infraHostIP.address === service.port.host.address) {
|
||||||
infraID = infraService.id;
|
infraID = infraService.id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,20 +36,20 @@ export class SearchFilterComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
addService(service: Service) {
|
addService(service: Service) {
|
||||||
if (service.name.indexOf('Not Supported Service') >= 0) {
|
if (service.key.indexOf('Not Supported Service') >= 0) {
|
||||||
const tempName = service.name.split('Perhaps ')[1].split('[')[0];
|
const tempName = service.key.split('Perhaps ')[1].split('[')[0];
|
||||||
service.name = '*' + tempName;
|
service.key = '*' + tempName;
|
||||||
}
|
}
|
||||||
let exist = false;
|
let exist = false;
|
||||||
this.services.forEach(value => {
|
this.services.forEach(value => {
|
||||||
if (value.name === service.name) {
|
if (value.key === service.key) {
|
||||||
exist = true;
|
exist = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
this.services.push(service);
|
this.services.push(service);
|
||||||
this.filterServices[service.name] = true;
|
this.filterServices[service.key] = true;
|
||||||
}
|
}
|
||||||
this.serviceSelect.emit(this.filterServices);
|
this.serviceSelect.emit(this.filterServices);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user