hostlist/portlist
This commit is contained in:
parent
e59b841577
commit
c96e0382c8
|
@ -24,5 +24,5 @@ export interface Host {
|
|||
discoveredDate?: Date;
|
||||
|
||||
zone?: Zone;
|
||||
// portList?: Port[];
|
||||
portList?: any[];
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@ export interface Zone {
|
|||
discoveredBy?: string[];
|
||||
discoveredDate?: Date;
|
||||
|
||||
// hostList?: Host[];
|
||||
hostList?: any[];
|
||||
}
|
||||
|
|
|
@ -250,28 +250,28 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
|||
console.log(node);
|
||||
this.displaySidebar = true;
|
||||
|
||||
// switch (node.group) {
|
||||
// case 'zone':
|
||||
// var zone: Zone = node.target;
|
||||
// zone.hostList = [];
|
||||
// this.hosts.forEach(host => {
|
||||
// if (host.zone.network === zone.network) {
|
||||
// zone.hostList.push(host);
|
||||
// }
|
||||
// });
|
||||
// break;
|
||||
// case 'host':
|
||||
// var host: Host = node.target;
|
||||
// host.portList = [];
|
||||
// this.ports.forEach(port => {
|
||||
// if (port.host.address === host.address) {
|
||||
// host.portList.push(port);
|
||||
// }
|
||||
// });
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
switch (node.group) {
|
||||
case 'zone':
|
||||
var zone: Zone = node.target;
|
||||
zone.hostList = [];
|
||||
this.hosts.forEach(host => {
|
||||
if (host.zone.network === zone.network) {
|
||||
zone.hostList.push(host);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'host':
|
||||
var host: Host = node.target;
|
||||
host.portList = [];
|
||||
this.ports.forEach(port => {
|
||||
if (port.host.address === host.address) {
|
||||
host.portList.push(port);
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.selectedNode = node;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user