This commit is contained in:
insanity 2018-09-12 20:29:24 +09:00
parent bab2dbfb94
commit 31d0245490
4 changed files with 26 additions and 29 deletions

View File

@ -1,5 +1,5 @@
import { Zone } from './Zone'; import { Zone } from './Zone';
import { Port } from './Port'; // import { Port } from './Port';
import { MetaIPType } from '../meta'; import { MetaIPType } from '../meta';
export const defaultOsType = 'UNKNOWN'; export const defaultOsType = 'UNKNOWN';
@ -24,5 +24,5 @@ export interface Host {
discoveredDate?: Date; discoveredDate?: Date;
zone?: Zone; zone?: Zone;
portList?: Port[]; // portList?: Port[];
} }

View File

@ -1,5 +1,4 @@
import { Host } from './Host'; import { Host } from './Host';
import { Service } from './Service';
import { MetaPortType } from '../meta'; import { MetaPortType } from '../meta';
export interface Port { export interface Port {
@ -11,5 +10,5 @@ export interface Port {
discoveredDate?: Date; discoveredDate?: Date;
host?: Host; host?: Host;
serviceList?: Service[]; // serviceList?: Service[];
} }

View File

@ -1,4 +1,3 @@
import { Host } from './Host';
import { MetaIPType } from '../meta'; import { MetaIPType } from '../meta';
export interface Zone { export interface Zone {
@ -12,5 +11,5 @@ export interface Zone {
discoveredBy?: string[]; discoveredBy?: string[];
discoveredDate?: Date; discoveredDate?: Date;
hostList?: Host[]; // hostList?: Host[];
} }

View File

@ -8,7 +8,6 @@ import { Zone, Host, Port, Service, DiscoverHost } from '@overflow/model/discove
import { RPCSubscriber } from '@overflow/commons/ui/decorator/RPCSubscriber'; import { RPCSubscriber } from '@overflow/commons/ui/decorator/RPCSubscriber';
import { DiscoveryConfigService } from '../../../commons/service/discovery-config.service'; import { DiscoveryConfigService } from '../../../commons/service/discovery-config.service';
import { Observable } from 'rxjs';
import * as d3 from 'd3'; import * as d3 from 'd3';
import { Node } from '../../../commons/model/node'; import { Node } from '../../../commons/model/node';
@ -251,28 +250,28 @@ export class HomePageComponent implements OnInit, OnDestroy {
console.log(node); console.log(node);
this.displaySidebar = true; this.displaySidebar = true;
switch (node.group) { // switch (node.group) {
case 'zone': // case 'zone':
var zone: Zone = node.target; // var zone: Zone = node.target;
zone.hostList = []; // zone.hostList = [];
this.hosts.forEach(host => { // this.hosts.forEach(host => {
if (host.zone.network === zone.network) { // if (host.zone.network === zone.network) {
zone.hostList.push(host); // zone.hostList.push(host);
} // }
}); // });
break; // break;
case 'host': // case 'host':
var host: Host = node.target; // var host: Host = node.target;
host.portList = []; // host.portList = [];
this.ports.forEach(port => { // this.ports.forEach(port => {
if (port.host.address === host.address) { // if (port.host.address === host.address) {
host.portList.push(port); // host.portList.push(port);
} // }
}); // });
break; // break;
default: // default:
break; // break;
} // }
this.selectedNode = node; this.selectedNode = node;
} }