This commit is contained in:
crusader 2018-06-21 20:17:07 +09:00
parent be995c40bc
commit 09f98c885c
2 changed files with 11 additions and 11 deletions

View File

@ -147,7 +147,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
addInfraHost(infraHost: InfraHost) {
const target: Target = this.checkAlreadyTarget(infraHost.id);
const ip = infraHost.infraHostIPs[0].address
const ip = infraHost.infraHostIPs[0].address;
const idx = this.findHostIndex(ip);
this.hostNode.splice(idx, 0, {
type: 'HOST',
@ -261,7 +261,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
addService(service: Service) {
let exist = false;
this.infraServices.forEach(infraService => {
if (infraService.metaTargetServiceType.name === service.name &&
if (infraService.metaTargetServiceType.name === service.key &&
infraService.infraHostPort.port === service.port.portNumber &&
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 idx = this.findServiceIndex(targetHostNode.children, service.name);
const idx = this.findServiceIndex(targetHostNode.children, service.key);
targetHostNode.children.splice(idx, 0, {
type: 'SERVICE',
label: service.name + ' (' + service.port.portNumber + ')',
label: service.key + ' (' + service.port.portNumber + ')',
data: {
target: null,
date: null,
@ -285,7 +285,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
portNumber: service.port.portNumber,
object: service,
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) {
const infraService: InfraService = infra;
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) {
infraID = infraService.id;
}

View File

@ -36,20 +36,20 @@ export class SearchFilterComponent implements OnInit {
}
addService(service: Service) {
if (service.name.indexOf('Not Supported Service') >= 0) {
const tempName = service.name.split('Perhaps ')[1].split('[')[0];
service.name = '*' + tempName;
if (service.key.indexOf('Not Supported Service') >= 0) {
const tempName = service.key.split('Perhaps ')[1].split('[')[0];
service.key = '*' + tempName;
}
let exist = false;
this.services.forEach(value => {
if (value.name === service.name) {
if (value.key === service.key) {
exist = true;
return;
}
});
if (!exist) {
this.services.push(service);
this.filterServices[service.name] = true;
this.filterServices[service.key] = true;
}
this.serviceSelect.emit(this.filterServices);
}